@brightslides/uid
v0.0.2
Published
Unique id generator
Downloads
3
Readme
Unique id generator
A unique string generator for Javascript based on nanoid.
Install via npm
npm install @brightslides/uid --save
Usage
const {uid, Sequence} = require('@brightslides/uid');
// Generate a 25 character long unique id
const id = uid();
// Generate multiple sequential ids
const sequence = Sequence.create();
const id1 = sequence.uid();
const id2 = sequence.uid();
// Generate multiple sequential ids based on another id
const baseId = uid();
const sequence = Sequence.from(baseId);
const id1 = sequence.uid();
const id2 = sequence.uid();