Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uniqueid

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uniqueid

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

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.9K
increased by21.69%
Maintainers
1
Weekly downloads
 
Created
Source

uniqueid NPM version

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

Install

Install with npm:
npm i uniqueid --save-dev

Run tests

npm test

Usage

var uniqueId = require('uniqueid');
console.log(uniqueId('abc'));
//=> ['a', 'b', 'c'];

API

id

Generate a unique ID.

  • options {Object}: Optionally pass a prefix, suffix and/or `multiplier.
  • returns {String}: The unique id.

Optionally pass a prefix to prepend, a suffix to append, or a multiplier to use on the ID.

uniqueId(); //=> '25'

uniqueId({prefix: 'apple_'});
//=> 'apple_10'

uniqueId({suffix: '_orange'});
//=> '10_orange'

uniqueId({multiplier: 5});
//=> 5, 10, 15, 20...

To reset the id to zero, do id.reset().

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on September 14, 2014.

Keywords

FAQs

Package last updated on 14 Sep 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc