JSPM

random-chars-generator

0.2.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 3
    • Score
      100M100P100Q15460F
    • License MIT

    Random chars generation for different languages

    Package Exports

    • random-chars-generator

    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 (random-chars-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Random chars generator

    Supported charset

    1. Simplified chinese (gb2312)
    2. Sranditional chinese (big5)

    Install

    npm i random-chars-generator

    Usage

    import { RandomChar } from "random-chars-generator";
    
    // generate random char with locales
    // locales can be found here: http://www.lingoes.net/en/translator/langcode.htm
    
    // Generate english chars
    const enChar = RandomChar.generate("en");
    const enChar = RandomChar.generate("en-US");
    
    // Generate chinese chars
    
    // simplified/简体
    const zhChar = RandomChar.generate("zh");
    const zhChar = RandomChar.generate("zh-CN");
    const zhChar = RandomChar.generate("zh-SG");
    // simplified/繁体
    const zhChar = RandomChar.generate("zh-TW");
    const zhChar = RandomChar.generate("zh-HK");