0.1.0 • Published 8 years ago

getid v0.1.0

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

getID

npm npm

Generate a random ID.

By default, getID generates a random string with 22 characters:

//Import
var getID = require('getid');

//Generate a random string ID
var id = getID(); //Returns 'c14x5E22610MJqk8J15748', for example

You can use it with some options:

OptionDescription
lengthSet the length of the generated string. Default is 22.
prefixSet a prefix for the generated string.
suffixSet a suffix for the generated string.

Example:

var getID = require('getid');

//Generate a random string with options
var id = getID({length: 10, prefix: 'ID'}); //Returns 'ID4F52M26448'