JSPM

cjk-readings

0.2.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q22675F
    • License MIT

    Web service that generates readings for chinese characters.

    Package Exports

    • cjk-readings

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cjk-readings) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    cjk-readings

    Generates readings for CJK text. Currently only supports pinyin, but support for other languages is planned.

    Exports modules for use in Node apps, as well as a server which can be queries via HTTP.

    npm install -g cjk-readings

    Usage with node

    const { generatePinyin } = require('cjk-readings')
    
    const readings = generatePinyin("🇨🇳 汉字拼音 ➜ hàn zì pīn yīn")
    
    console.log(readings)
    // [["🇨🇳 ",[]],["汉",["hàn"]],["字",["zì"]],["拼",["pīn"]],["音",["yīn"]],[" ➜ hàn zì pīn yīn",[]]]

    Usage via http

    PORT=7346 cjk-readings-service
    curl http://localhost:7346/pinyin?text=%F0%9F%87%A8%F0%9F%87%B3%20%E6%B1%89%E5%AD%97%E6%8B%BC%E9%9F%B3%20%E2%9E%9C%20h%C3%A0n%20z%C3%AC%20p%C4%ABn%20y%C4%ABn
    
    # [["🇨🇳 ",[]],["汉",["hàn"]],["字",["zì"]],["拼",["pīn"]],["音",["yīn"]],[" ➜ hàn zì pīn yīn",[]]]~

    Acknowledgements

    Based on MIT Licensed work at:

    License

    MIT License