@brightslides/id-generator

Unique id generator

Usage no npm install needed!

<script type="module">
  import brightslidesIdGenerator from 'https://cdn.skypack.dev/@brightslides/id-generator';
</script>

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();