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

shortid

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shortid - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

examples/examples.js

7

package.json
{
"name":"shortid",
"version":"1.0.1",
"version":"1.0.2",
"description":"Short unique id generator. Url-friendly. Non-predictable. Cluster-compatible.",

@@ -16,3 +16,3 @@ "keywords": ["short", "tiny", "id", "uuid", "bitly", "shorten", "mongoid", "shortid", "tinyid", "id"],

"mail": "dylang@gmail.com",
"url": "http://github.com/dylang/sgortid/issues"
"url": "http://github.com/dylang/shortid/issues"
},

@@ -30,4 +30,3 @@ "dependencies":{

"scripts":{
"start":"node cluster",
"test": "nodeunit test"
"test": "make test"
},

@@ -34,0 +33,0 @@ "licenses" :

@@ -12,9 +12,36 @@ # ShortId [![Build Status](https://secure.travis-ci.org/dylang/Shortid.png)](http://travis-ci.org/dylang/Shortid)

## ShortId.generate() returns id
```javascript
var ShortId = require('../index');
var i = 10;
while (i--) {
console.log(ShortId.generate());
}
// Resulting ids:
PPBqWA9
PefBO4A
eV9B94A
eemGO4d
PPGBqhd
VPyX9hw
eeDX94w
PT7GOWA
PP4XqWA
PTxG9hD
```
Other functions (docs coming soon)
## ShortId.generate()
* ShortId.version(int) sets version, returns ShortId
* ShortId.worker(int) sets cluster worker, returns ShortId
Returns an id.
See the tests for more examples.
## Other functions
(Full docs coming soon.)
* ShortId.version(int) sets version, returns ShortId module.
* ShortId.worker(int) sets cluster worker, returns ShortId module.
See the tests for more examples.
Created for Node Knockout 2011 winner [Doodle Or Die](http://doodleordie.com).

Sorry, the diff of this file is not supported yet

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