Skip to content

jmjuanes/getid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

Option Description
length Set the length of the generated string. Default is 22.
prefix Set a prefix for the generated string.
suffix Set 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'

Releases

No releases published

Packages

No packages published