源代码: https://github.com/sofish/han
# 初衷与效果
初衷是想用在 url 上,当然结果也是,比如这样一句话,希望用在 url 中,可以这样来:
var han require('han')
han.letter('要实现 Speaker Deck 那种中文转拼音的', '-')
//输出 yao-shi-xian-speaker-deck-na-zhong-zhong-wen-zhuan-pin-yin-de
有乱码也没关系,可以看这个 testcase https://github.com/sofish/han#translating-messy-code
# 安装和使用
安装:npm install han
使用:见 repo 的 readme
# 开源协议
像我其他开源代码一样,基于 MIT 开源,也就是说你可以随便用,随便改。
欢迎各种 issue 和 pull request,哈哈。
# 初衷与效果
初衷是想用在 url 上,当然结果也是,比如这样一句话,希望用在 url 中,可以这样来:
var han require('han')
han.letter('要实现 Speaker Deck 那种中文转拼音的', '-')
//输出 yao-shi-xian-speaker-deck-na-zhong-zhong-wen-zhuan-pin-yin-de
有乱码也没关系,可以看这个 testcase https://github.com/sofish/han#translating-messy-code
# 安装和使用
安装:npm install han
使用:见 repo 的 readme
# 开源协议
像我其他开源代码一样,基于 MIT 开源,也就是说你可以随便用,随便改。
欢迎各种 issue 和 pull request,哈哈。