1.0.1 • Published 8 years ago

unique-id-generator v1.0.1

Weekly downloads
9
License
ISC
Repository
github
Last release
8 years ago

unique-id-generator

Utility to generate unique ID based on Date.now()

##Why? This function is meant to return an unique ID using the value of Date.now(), it ensures that the IDs are unique (from all other IDs generated by an instances of this module)

##How to use it? 1.- Install it in your project:

npm install unique-id-generator -S

2.- Require it:

var generateID = require("unique-id-generator");

3.- Use it:

var id = generateID({prefix:"id-"});
//generates something like id-1476734792457

4.- Profit.

##API ###uniqueIdGenerator(options)

###options ####prefix Type: String

Adds specified prefix at the beginning of the generated ID.

####suffix Type: String

Adds specified suffix at the end of the generated ID.