Skip to content

Generate a unique sequential ID. Optionally pass a prefix, suffix, or multiplier.

License

Notifications You must be signed in to change notification settings

jonschlinkert/uniqueid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uniqueid

NPM version NPM downloads Build status Test coverage

Generate sequential IDs, with optional prefix or suffix.

Installation

npm i uniqueid --save-dev

Usage

var uniqueid = require('uniqueid')
var first = uniqueid('prefix')
var second = uniqueid(null, 'suffix')

console.log(first()) //=> "prefix0"
console.log(second()) //=> "0suffix"
console.log(first()) //=> "prefix1"
console.log(second()) //=> "1suffix"
  • prefix Set the prefix for id generation (string, default: '')
  • suffix Set the suffix for id generation (string, default: '')

Typings

Includes a TypeScript definition.

Contributing

npm install
npm test

License

Copyright (c) 2014 Jon Schlinkert, contributors.

Released under the MIT license

About

Generate a unique sequential ID. Optionally pass a prefix, suffix, or multiplier.

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published