V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
andyhu
V2EX  ›  Node.js

nodejs 音译(transliteration)模块,支持中文转拼音或生成 slug

  •  
  •   andyhu · 2014-08-27 16:51:50 +08:00 · 8259 次点击
    这是一个创建于 3501 天前的主题,其中的信息可能已经有所发展或是发生改变。
    https://github.com/andyhu/node-transliteration
    用法:
    var transliteration = require('transliteration');
    transliteration.transliterate('你好,世界'); // Ni Hao ,Shi Jie
    transliteration.slugify('你好,世界'); // ni-hao-shi-jie
    transliteration.slugify('你好,世界', {lowercase: false, separator: '_'}); // Ni_Hao_Shi_Jie
    2 条回复
    YAFEIML
        1
    YAFEIML  
       2014-08-27 22:22:25 +08:00
    这个屌啊
    rekey
        2
    rekey  
       2014-08-28 19:16:57 +08:00
    赞一个,很有用啊。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1848 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:27 · PVG 00:27 · LAX 09:27 · JFK 12:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.