Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@spider_webs/genid

JoshMatthew49MIT1.0.7

An ID generator

readme

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