uniqueid

Generate sequential IDs, with optional prefix or suffix

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
uniqueid
1701.0.08 years ago10 years agoMinified + gzip package size for uniqueid in KB

Readme

uniqueid
!NPM versionnpm-imagenpm-url !NPM downloadsdownloads-imagedownloads-url !Build statustravis-imagetravis-url !Test coveragecoveralls-imagecoveralls-url
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