🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

uniqueid

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uniqueid

Generate sequential IDs, with optional prefix or suffix

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
4.8K
11.58%
Maintainers
2
Weekly downloads
 
Created
Source

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

Keywords

unique

FAQs

Package last updated on 21 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts