random-char
Generate a random character.
Install
$ npm install --save random-char
Usage
var randomChar = require('random-char');
randomChar();
randomChar('upper');
randomChar('aeiou');
API
randomChar(pool)
Randomly pick a char from a pool.
Preset pools:
'lower'
- 'abcdefghijklmnopqrstuvwxyz'
'upper'
- 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
'number'
- '0123456789'
'symbol'
- '!@#$%^&*()[]'
'alpha'
- 'lower'
+ 'upper'
'undefined'
- 'lower'
+ 'upper'
+ number
+ 'symbol'
Custom pool: randomChar('something');
Related
Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.