node package manager


create unique identifiers


Create unique identifiers.

Default characters : 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

An id based on a number.

var unique = require('uniquely');; // 'Lmm' 

An unique id, from your characters, based on microtime

unique.time(); // '5Pp68s5wk' 

A random id, from your characters, specified number of characters

unique.random(10); // 'e90WFdthcl' 
unique.random(10); // 'XnP2uvVw7r' 

A way to create sequential ids, using es6 iterators

var it = unique.iterator();; // '0' 
// some tens of thousands iterations later...; // 'aRG' 

The above functions, with your own set of characters

var create = unique.create;
var abc = create('abc');; // 'cccbcacaaa' 
abc.random(10); // 'acbccbcaba' 
abc.time(); // 'acacccaabccbacaabaccacbacbbcbbbb'