@varld/id
v0.1.1
Published
A simple package for generating secure, safe and short ids.
Downloads
1
Readme
Varld's Id Generator
A simple package for generating secure, safe and short ids.
Install
npm install @varld/id
# using yarn
yarn add @varld/id
Usage
import generateId from '@varld/id';
let id = generateId();
// result: V1StGXR8_Z5jdHi6B-myT
// with a prefix
let prefixedId = generateId('prefix');
// result: prefixV1StGXR8_Z5jdHi6B-myT
// with a prefix and a separator
let prefixedIdWithSeparator = generateId({
prefix: 'prefix',
separator: '_'
});
// result: prefix_V1StGXR8_Z5jdHi6B-myT
License
MIT © Tobias Herber