raidmaker
It makes random strings per specified length. It can be used as id in database and apps supported by the environment.
Requirement
Installation
Use the package manager npm to install raidmaker.
npm install raidmaker
Usage
const raidmaker = require('raidmaker');
const { generate } = require('raidmaker');
console.log(generate(8, {no: 6}));
generate
Generate the strings given the length
length
length of string returned. default
: 5
options
no
of id element in the returned Array
. default
: 1, a string
is returned
mode
either of:
- apnr
|| alphanumeric
for alphanumeric
- figs
|| figures
for figures
- alpha
|| alphabets
for alphabets
- as
|| alphaspecial
for alphabets with special characters
- all
for all characters
console.log(raidmaker.generate(5));
console.log(raidmaker.generate(25, {mode: 'alphaspecial'}));
console.log(raidmaker.generate(25, {mode: 'apnr'}));
console.log(raidmaker.generate(25, {mode: 'alpha'}));
console.log(raidmaker.generate(25, {mode: 'all'}));
console.log(raidmaker.generate(25, {mode: 'figs'}));
Project Status, Whats new?
- default length
- support for more than one elements
Support, Suggestion, Bugs...
Visit the Github repository. Thanks