{"bugs":{"url":"https://github.com/nats-io/nuid.js/issues"},"dist":{"shasum":"d232807ae481e5407c64b46b4e0969f5b50565b1","tarball":"https://registry.npmjs.org/nuid/-/nuid-2.0.0-2.tgz","fileCount":32,"integrity":"sha512-Q7QAilfdDOVEmVefCAndU0NhQPKSz4GA3clBQ1KrjOdVzMSAF8VGQoaeaA+U4so8FW//RABEXn/UBR6FP+M+/g==","signatures":[{"sig":"MEUCIE/7g7E8SPzdW2pEQsY4U8p8KgvSY8Dk3Rr5vzSGDT2/AiEAvA6CiblRk+D3sW1hrTLtMCtY0rFt5sRcxSdY4EJ+wSo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":173530},"main":"./index.js","name":"nuid","author":{"name":"The NATS Authors"},"readme":"# NODE NUID\n\n[![license](https://img.shields.io/github/license/nats-io/node-nuid.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![npm](https://img.shields.io/npm/v/nuid.svg)](https://www.npmjs.com/package/nuid)\n[![npm](https://img.shields.io/npm/dt/nuid.svg)](https://www.npmjs.com/package/nuid)\n[![npm](https://img.shields.io/npm/dm/nuid.svg)](https://www.npmjs.com/package/nuid)\n\nA highly performant unique identifier generator.\n\n## Installation\n\nImport the library for node/bun:\n\n```bash\nnpm install nuid\n```\n\nFor web and deno you can also:\n\n```bash\nnpx jsr add @nats-io/nuid\n```\n\n## Basic Usage\n\nReference the library in your code. If using you can `import` or `require` the\nnpm nuid library supports both Common JS and ESM:\n\n```javascript\nconst { nuid, Nuid } = require(\"nuid\");\n// or\nimport { next, Nuid } from \"nuid\";\n\n// `nuid` is a global instance of nuid, you can use it directly\n// `Nuid` is the actual class implementing the nuids, so you can also\n// `new Nuid()`.\n```\n\n```javascript\n// To generate a bunch of nuids:\nlet id = nuid.next();\nid = nuid.next();\n//\n\n// To generate a new prefix:\nnuid.reset();\n// note that prefixes are automatically rolled whenever all\n// the nuids for the specific prefix have been used.\nid = nuid.next();\n```\n\n## Performance\n\nNUID needs to be very fast to generate and be truly unique, all while being\nentropy pool friendly. NUID uses 12 bytes of crypto generated data (entropy\ndraining), and 10 bytes of pseudo-random sequential data that increments with a\npseudo-random increment.\n\nTotal length of a NUID string is 22 bytes of base 36 ascii text, so 36^22 or\n17324272922341479351919144385642496 possibilities.\n\n## Migration\n\nThe 2.x version of the npm module support both CJS and ESM modules, an ESM only\nversion of the module is available via\n[jsr @nats-io/nuid](https://jsr.io/@nats-io/nuid)\n\nIf you are migrating from the 1.x.x series, note that `getGlobalNuid()`,\n`next()` and `reset()` and `version` property have been removed. Instead, access\nthe exported constant `nuid` and call `next()` or `reset()` on it as shown in\nthe examples above. For version information please refer to your installed\nmodule's version information.\n\nIf you are migrating from the `js-nuid` module in npm, there should be no\nchanges except to the location of the import in the npm bundle:\n\n```typescript\nimport { nuid } from \"./node_modules/esm/index.js\";\n```\n\n## Supported Node Versions\n\nSupport policy for Nodejs versions follows\n[Nodejs release support](https://github.com/nodejs/Release). We will support and\nbuild nuid on even Nodejs versions that are current or in maintenance.\n\n## License\n\nUnless otherwise noted, the NATS source files are distributed under the Apache\nVersion 2.0 license found in the LICENSE file.\n","engines":{"node":">= 18.x"},"exports":{"types":"./lib/nuid.d.ts","import":"./esm/index.mjs","require":"./lib/nuid.js"},"gitHead":"2fa27bb30c5f07e6cd838f44ecdec887283ffeaa","license":"Apache-2.0","private":false,"scripts":{"doc":"rm -Rf ./docs && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll","lint":"deno lint --ignore=docs/,debug/,lib/","test":"npm run build && node --test test/basics.js && deno test","build":"npm run clean && deno bundle src/nuid.ts esm/index.mjs && tsc","clean":"shx rm -f esm/index.mjs lib/nuid.d.ts lib/nuid.js lib/nuid.js.map","prepack":"npm run build"},"_npmUser":{"name":"aricart","email":"alberto@synadia.com"},"homepage":"https://nats.io/nuid.js","keywords":["unique","identifier","generator"],"deprecated":"Package deprecated. Use @nats-io/nuid instead: https://www.npmjs.com/package/@nats-io/nuid","repository":{"url":"git+ssh://git@github.com/nats-io/nuid.js.git","type":"git"},"_npmVersion":"10.7.0","description":"NUID - A highly performant unique identifier generator.","directories":{},"maintainers":[{"name":"aricart","email":"alberto@synadia.com"}],"_nodeVersion":"22.1.0","contributors":[],"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"shx":"^0.3.4","typedoc":"^0.25.13","typescript":"^5.4.5"},"_npmOperationalInternal":{"tmp":"tmp/nuid_2.0.0-2_1716490089118_0.8757933212805589","host":"s3://npm-registry-packages"},"_id":"nuid@2.0.0-2","version":"2.0.0-2"}