random-char
Return a random character.
Install
$ npm install --save random-char
Usage
For more use-cases see the tests
var randomChar = ; // API// - randomChar([poolName]);// - randomChar([options]); ;// => 'k'
By default it will return a string with random character from the following pool:
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&()*_+-={}[]'
Optionally specify a pool:
; // or;// => 'm' ; // or;// => 'Z' ; // or;// => 'j' ; // or;// => '7' ; // or;// => '%'
Optionally specify a pool and the character will be generated with characters only from that pool:
; // or;// => 'c'
Related
- random-integral - Return a random integer.
- random-natural - Return a random natural number.
- random-decimal - Return a random decimal.
- random-floating - Return a random floating point number.
- random-index - Return a random array-like index.
- random-binary - Return a random binary number.
- random-octal - Return a random octal number.
- random-hexadecimal - Return a random hexadecimal number.
- random-unicode - Return a random unicode.
- random-bool - Return a random boolean (true/false).
Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.