Skip to content

JoshMatthew/genid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

genid

genid is an id generator.

Installation

npm install @spider_webs/genid

this will add the module as your dependency.

Usage

To use it is very simple, just import the package

const genid = require("@spider_webs/genid");

Then by default genid will create a random id by the format "nnnnnllnn_lll_nlnl_nll"
'n' stands for number and 'l' stands for letter. The only separator available at the
moment is by using underscore "_".

To create your custom id format, just simply add the format as the parameter. For instance,
to create a random id with five numbers I can pass 'nnnnn' to the parameter as an argument to generate five random numbers.

console.log(genid("nnnnn"));

and it should give a random number similar to this 23749.

Contact

add me on facebook
contact me on email
check me on github

About

genid is an id generator.

Resources

Stars

Watchers

Forks

Packages

No packages published