1.0.1 • Published 8 years ago

unqid v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

unqid

Generate a unique id with optional prefix

Install

$ npm install --save unqid

Example

var unqid = require('unqid');
console.log(unqid('sample_'));

// -> sample_1

console.log(unqid('sample_'));
console.log(unqid('sample_'));
console.log(unqid('sample_'));

// ->
//  sample_2
// sample_3
// sample_4

console.log(unqid());
console.log(unqid());
// ->
//  1
// 2

require('unqid')(prefix)

Arguments:

  • prefix: It's an string with prefix value to be attached to each unique value
  • The prefix option can be optional, in this case it will generate sequential ids

Returns: Returns a string which is unique id throughout the context

License

© 2016 Vikram Jadhav. MIT License

1.0.1

8 years ago

1.0.0

8 years ago