string-random
Generate random string
Installation
string-random is available as an npm package.
npm i string-random
Document
random([length],[options])
length
{number} the length of the result, default 8
options
{boolean|object} default {}, true=={specials: true}
options.numbers
{boolean|string} should contain numbers, default true, if is string, only contain assigned numbers.
options.letters
{boolean|string} should contain letters, default true, if is string, only contain assigned letters.
options.specials
{boolean|string} should contain specials, default false, if is string, only contain assigned specials.
Example
const random = ;//import random from 'string-random'; console; //jcBvYzfaconsole; //d9oq0A3vooaDod8Xconsole; //AgfPTKheCgMvwNqXconsole; //0889014544916637console; //055B1627E43GA7D8console; //,o=8l{iay>AOegW[console; //)-[+$^%+$|)-{(]%console; //:;:;;;:;;;;;;;::console; //SMm,EjETKMldIM/J
Contribute
License
This project is licensed under the terms of the MIT license