This package will generate a random string with params, for example you can use this package to generate passwords.
npm i randomstringsgenerator
Or
yarn add randomstringsgenerator
Next we import it
const rsg = require('randomstringsgenerator')
The packge accepts 2 inputs, if you call the generator without passing any params,
it will return a random string including lowerCase and numbers only, with the length of 10 chars.
1- length => a number, represents the length of the string.
2- params => Array [] accepts the following strings ['upperCase', 'lowerCase', 'specialChars', 'numbers'].
rsg(length,params)
If i want a random string including uppercase, lowercase, special characters and numbers, with a length of 15
rsg(15,['numbers','upperCase','lowerCase','specialChars'])