README.md000066400000000730151123523640006027 0ustar00# gud > Create a 'gud nuff' (not cryptographically secure) globally unique id ## Install ``` yarn add gud ``` ## Usage ```js const gud = require('gud'); console.log(gud()); // 1 console.log(gud()); // 2 ``` This is ever so slightly better than using something like `_.uniqueId` because it will work across multiple copies of the same module. Do not use this in place of actual UUIDs, security folks will hate me. This will not be unique across processes/workers. index.js000066400000000213151123523640006211 0ustar00// @flow 'use strict'; var key = '__global_unique_id__'; module.exports = function() { return global[key] = (global[key] || 0) + 1; }; package.json000066400000002762151123523640007045 0ustar00{ "_args": [ [ "gud@1.0.0", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "gud@1.0.0", "_id": "gud@1.0.0", "_inBundle": false, "_integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==", "_location": "/gud", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "gud@1.0.0", "name": "gud", "escapedName": "gud", "rawSpec": "1.0.0", "saveSpec": null, "fetchSpec": "1.0.0" }, "_requiredBy": [ "/@hypnosphi/create-react-context" ], "_resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz", "_spec": "1.0.0", "_where": "/home/freeclou/app.optimyar.com/backend", "author": { "name": "Jamie Kyle", "email": "me@thejameskyle.com" }, "bugs": { "url": "https://github.com/jamiebuilds/global-unique-id/issues" }, "description": "Create a 'gud nuff' (not cryptographically secure) globally unique id", "devDependencies": { "ava": "^0.25.0", "flow-bin": "^0.66.0" }, "files": [ "index.js" ], "homepage": "https://github.com/jamiebuilds/global-unique-id#readme", "keywords": [ "global", "unique", "id", "identifier", "number", "uuid", "uid" ], "license": "MIT", "main": "index.js", "name": "gud", "repository": { "type": "git", "url": "git+https://github.com/jamiebuilds/global-unique-id.git" }, "scripts": { "test": "ava" }, "version": "1.0.0" }