Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calidion/random-chars-generator
random charactor generator for utf8
https://github.com/calidion/random-chars-generator
chars nodejs random
Last synced: about 2 months ago
JSON representation
random charactor generator for utf8
- Host: GitHub
- URL: https://github.com/calidion/random-chars-generator
- Owner: calidion
- License: mit
- Created: 2017-07-07T08:53:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T05:48:45.000Z (almost 2 years ago)
- Last Synced: 2024-02-22T19:34:00.034Z (11 months ago)
- Topics: chars, nodejs, random
- Language: TypeScript
- Homepage:
- Size: 930 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Random chars generator
## Supported charset
1. Simplified chinese (gb2312)
2. Sranditional chinese (big5)## Install
```
npm i random-chars-generator
```# Usage
```ts
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");```