1.0.0 • Published 8 years ago

uniqueid v1.0.0

Weekly downloads
1,126
License
MIT
Repository
github
Last release
8 years ago

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