{"_id":"@nats-io/nuid","_rev":"7-94c65e671767abffd2daf4da1489bbf4","name":"@nats-io/nuid","dist-tags":{"latest":"3.0.0","next":"3.0.0-0"},"versions":{"2.0.1-2":{"name":"@nats-io/nuid","version":"2.0.1-2","keywords":["unique","identifier","generator"],"author":{"name":"The NATS Authors"},"license":"Apache-2.0","_id":"@nats-io/nuid@2.0.1-2","contributors":[],"homepage":"https://nats.io/nuid.js","bugs":{"url":"https://github.com/nats-io/nuid.js/issues"},"dist":{"shasum":"ec2d9bd0879fecfea1996dcc1f820af6860ea52f","tarball":"https://registry.npmjs.org/@nats-io/nuid/-/nuid-2.0.1-2.tgz","fileCount":8,"integrity":"sha512-oXJiWXH87FjcPAXVVkoY+o7z9YFuOvsVlUlvB4h/QsoC1hp63lB18YOMHmKxVNO7BzvwzJh3SKLlIlsQrEwaxg==","signatures":[{"sig":"MEUCIHkDOhOLAvcSNFuKoCUVO3pD+PjW1EYgFva15wr4I/UkAiEAy130RPvPl+nXsc5fAn+xlpkxRKjk6EkyiQrf0Xa/Fsw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":23506},"main":"./lib/nuid.js","types":"./lib/nuid.d.ts","engines":{"node":">= 18.x"},"gitHead":"92d61072ee7cb7ee9e06be383ac3712dee229e9c","private":false,"scripts":{"doc":"rm -Rf ./docs && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll","fmt":"deno fmt src/ README.md MAINTAINERS.md CODE-OF-CONDUCT.md","lint":"deno lint --ignore=docs/,debug/,lib/","test":"npm run build && node --test test/basics.js && deno test","build":"npm run clean && 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"},"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":{},"_nodeVersion":"22.2.0","_hasShrinkwrap":false,"devDependencies":{"shx":"^0.3.4","typedoc":"^0.25.13","typescript":"^5.4.5"},"_npmOperationalInternal":{"tmp":"tmp/nuid_2.0.1-2_1719334546363_0.38366177979963556","host":"s3://npm-registry-packages"}},"2.0.1-3":{"name":"@nats-io/nuid","version":"2.0.1-3","keywords":["unique","identifier","generator"],"author":{"name":"The NATS Authors"},"license":"Apache-2.0","_id":"@nats-io/nuid@2.0.1-3","maintainers":[{"name":"philpennock","email":"npm-packaging@pennock-tech.com"},{"name":"aricart","email":"alberto@synadia.com"},{"name":"derek","email":"derek@nats.io"}],"contributors":[],"homepage":"https://nats.io/nuid.js","bugs":{"url":"https://github.com/nats-io/nuid.js/issues"},"dist":{"shasum":"39236dec8c0b51db9283cb9ab9d32a941df0f6da","tarball":"https://registry.npmjs.org/@nats-io/nuid/-/nuid-2.0.1-3.tgz","fileCount":8,"integrity":"sha512-K0yoRbfnRcJhVyAyvbOjtWAp7eywDrNdYFPgoXxGkUrRz8nLvorfec6CsmJTNhCs4e23UJticT98B1ARor0T0Q==","signatures":[{"sig":"MEYCIQCeECtBg8YRHW5D9FWnCR05nsUTsPw9zCV6m55Yn/vnEgIhAJAFPYlOOk9wbC5f6tk1XT00y35rAcqQ6a6foXgMvQun","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":23936},"main":"./lib/nuid.js","types":"./lib/nuid.d.ts","engines":{"node":">= 18.x"},"gitHead":"6c32b2827b9aab46767f02aa9e354036c5061713","scripts":{"doc":"rm -Rf ./docs && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll","test":"npm run build && node --test test/basics.js && deno test","build":"npm run clean && tsc","clean":"shx rm -Rf ./lib ./coverage","prepack":"npm run build"},"_npmUser":{"name":"aricart","email":"alberto@synadia.com"},"repository":{"url":"git+ssh://git@github.com/nats-io/nuid.js.git","type":"git"},"_npmVersion":"10.9.0","description":"NUID - A highly performant unique identifier generator.","directories":{},"_nodeVersion":"23.2.0","_hasShrinkwrap":false,"devDependencies":{"shx":"^0.3.4","typedoc":"^0.27.3","typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/nuid_2.0.1-3_1733518763270_0.05951390625062647","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"@nats-io/nuid","version":"2.0.1","keywords":["unique","identifier","generator"],"author":{"name":"The NATS Authors"},"license":"Apache-2.0","_id":"@nats-io/nuid@2.0.1","maintainers":[{"name":"philpennock","email":"npm-packaging@pennock-tech.com"},{"name":"aricart","email":"alberto@synadia.com"},{"name":"derek","email":"derek@nats.io"}],"contributors":[],"homepage":"https://nats.io/nuid.js","bugs":{"url":"https://github.com/nats-io/nuid.js/issues"},"dist":{"shasum":"1d9fc16aca481e3e2d30a2244b4507176b7a16c7","tarball":"https://registry.npmjs.org/@nats-io/nuid/-/nuid-2.0.1.tgz","fileCount":8,"integrity":"sha512-9zsot/tPKBMPqeAst1xxHyvYKx+utgHsUCKlg49xlBbxbmFThl5577HALZHnqISpaaf8kZoHr/xEwj/TP9mfLg==","signatures":[{"sig":"MEQCIDK3cuZpem3syr7Il6ZpFsbMeFB6TsKYdHakVoGgKqxaAiBpWTmDhuIqKlJF2qdGvTIRKGuMk+gl//I8J4Nw8qsSbA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@nats-io%2fnuid@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23934},"main":"./lib/nuid.js","types":"./lib/nuid.d.ts","engines":{"node":">= 18.x"},"gitHead":"4d45cbff8448ed3174c36d03da75e3610ffcaa5d","scripts":{"doc":"rm -Rf ./docs && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll","test":"npm run build && node --test test/basics.js && deno test","build":"npm run clean && tsc","clean":"shx rm -Rf ./lib ./coverage","prepack":"npm run build"},"_npmUser":{"name":"aricart","email":"alberto@synadia.com"},"repository":{"url":"git+ssh://git@github.com/nats-io/nuid.js.git","type":"git"},"_npmVersion":"10.9.2","description":"NUID - A highly performant unique identifier generator.","directories":{},"_nodeVersion":"22.11.0","_hasShrinkwrap":false,"devDependencies":{"shx":"^0.3.4","typedoc":"^0.27.3","typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/nuid_2.0.1_1733519318890_0.4023030846958069","host":"s3://npm-registry-packages"}},"2.0.2":{"name":"@nats-io/nuid","version":"2.0.2","keywords":["unique","identifier","generator"],"author":{"name":"The NATS Authors"},"license":"Apache-2.0","_id":"@nats-io/nuid@2.0.2","maintainers":[{"name":"philpennock","email":"npm-packaging@pennock-tech.com"},{"name":"aricart","email":"alberto@synadia.com"},{"name":"derek","email":"derek@nats.io"}],"contributors":[],"homepage":"https://nats.io/nuid.js","bugs":{"url":"https://github.com/nats-io/nuid.js/issues"},"dist":{"shasum":"556eaa5a424b3f8723df30299f17b3bfcccfaa38","tarball":"https://registry.npmjs.org/@nats-io/nuid/-/nuid-2.0.2.tgz","fileCount":8,"integrity":"sha512-w/Fw60/uj9yrljvTSplXpHxZ9ybBMKnsb9IQioXC0Tt/TmlBcnRX229aFUmnnkL24QK1OqvILtaqojJ1KpLitQ==","signatures":[{"sig":"MEYCIQCcrZgS/MClH971ki0EG2w15HArllvl8CAtK3nLM/Pd/QIhALVoUWewuRS3WXMEPWIROF6UZTou2JgaXu6piKRDgcw2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@nats-io%2fnuid@2.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23838},"main":"./lib/nuid.js","types":"./lib/nuid.d.ts","engines":{"node":">= 18.x"},"gitHead":"0ee313af51965abd6cb7d3dbc0cfc732695932ec","scripts":{"doc":"rm -Rf ./docs && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll","test":"npm run build && node --test test/basics.js && deno test","build":"npm run clean && tsc","clean":"shx rm -Rf ./lib ./coverage","prepack":"npm run build"},"_npmUser":{"name":"aricart","email":"alberto@synadia.com"},"repository":{"url":"git+ssh://git@github.com/nats-io/nuid.js.git","type":"git"},"_npmVersion":"11.0.0","description":"NUID - A highly performant unique identifier generator.","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"shx":"^0.3.4","typedoc":"^0.27.6","typescript":"^5.7.3"},"_npmOperationalInternal":{"tmp":"tmp/nuid_2.0.2_1737061311792_0.3973914685396298","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@nats-io/nuid","version":"2.0.3","keywords":["unique","identifier","generator"],"author":{"name":"The NATS Authors"},"license":"Apache-2.0","_id":"@nats-io/nuid@2.0.3","maintainers":[{"name":"philpennock","email":"npm-packaging@pennock-tech.com"},{"name":"aricart","email":"alberto@synadia.com"},{"name":"derek","email":"derek@nats.io"}],"contributors":[],"homepage":"https://nats.io/nuid.js","bugs":{"url":"https://github.com/nats-io/nuid.js/issues"},"dist":{"shasum":"3afe66825dcb2921386d9a43ba1175a2e36d528c","tarball":"https://registry.npmjs.org/@nats-io/nuid/-/nuid-2.0.3.tgz","fileCount":8,"integrity":"sha512-TpA3HEBna/qMVudy+3HZr5M3mo/L1JPofpVT4t0HkFGkz2Cn9wrlrQC8tvR8Md5Oa9//GtGG26eN0qEWF5Vqew==","signatures":[{"sig":"MEYCIQDokBctaDPtEJxUZ3b8+sCqnmdgp3bjmllsEVJ3SHOydAIhALhmH9ihaI8SASI/76AUJFpEIpYS6QffuKpZT9djDJpX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@nats-io%2fnuid@2.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23838},"main":"./lib/nuid.js","types":"./lib/nuid.d.ts","engines":{"node":">= 18.x"},"gitHead":"4813e1016bd4d9358f77e94e66985856c7c0da23","scripts":{"doc":"rm -Rf ./docs && node_modules/.bin/typedoc --out ./docs/ && touch ./docs/.nojekyll","test":"npm run build && node --test test/basics.js && deno test","build":"npm run clean && tsc","clean":"shx rm -Rf ./lib ./coverage","prepack":"npm run build"},"_npmUser":{"name":"aricart","email":"alberto@synadia.com"},"repository":{"url":"git+ssh://git@github.com/nats-io/nuid.js.git","type":"git"},"_npmVersion":"11.0.0","description":"NUID - A highly performant unique identifier generator.","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"shx":"^0.3.4","typedoc":"^0.27.6","typescript":"^5.6.3"},"_npmOperationalInternal":{"tmp":"tmp/nuid_2.0.3_1737069327441_0.7109989794284386","host":"s3://npm-registry-packages-npm-production"}},"3.0.0-0":{"name":"@nats-io/nuid","version":"3.0.0-0","keywords":["unique","identifier","generator"],"author":{"name":"The NATS Authors"},"license":"Apache-2.0","_id":"@nats-io/nuid@3.0.0-0","maintainers":[{"name":"philpennock","email":"npm-packaging@pennock-tech.com"},{"name":"aricart","email":"alberto@synadia.com"},{"name":"derek","email":"derek@nats.io"}],"contributors":[],"homepage":"https://nats.io/nuid.js","bugs":{"url":"https://github.com/nats-io/nuid.js/issues"},"dist":{"shasum":"6ad04d7950f6d79f5da6f104e7e95eec4a46362f","tarball":"https://registry.npmjs.org/@nats-io/nuid/-/nuid-3.0.0-0.tgz","fileCount":11,"integrity":"sha512-iL6MtGTOcJwIa28+YF0t+rDRhDXScKTFCFbYu7WQso+Vyxrzn2d6Atu0LummPrGVjvSBcmNZ2q5xBH7XAIM45Q==","signatures":[{"sig":"MEQCICJJ+g+xWRKOwL6eRJqcrfCUI4KZcq3RYTNv8e/OqOnzAiAWJOQTVZPipmsdIdNgFvNTScT0IbweE9Sb+y3vEWICRA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@nats-io%2fnuid@3.0.0-0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":30674},"main":"./lib/mod.js","types":"./lib/mod.d.ts","engines":{"node":">= 22.x"},"gitHead":"6ee4c6c857a26808e07f96943d43b567aedc79af","scripts":{"doc":"typedoc --out ./docs/ && touch ./docs/.nojekyll","test":"npm run build && node --test test/basics.js && deno test","build":"npm run clean && tsc","clean":"rm -rf ./lib ./coverage ./docs","prepack":"npm run clean && npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:244669b5-dc83-466d-83ea-abb19a5cdcc7"}},"repository":{"url":"git+ssh://git@github.com/nats-io/nuid.js.git","type":"git"},"_npmVersion":"11.13.0","description":"NUID - A highly performant unique identifier generator.","directories":{},"_nodeVersion":"25.9.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"typedoc":"^0.28.19","typescript":"^5.9.2"},"_npmOperationalInternal":{"tmp":"tmp/nuid_3.0.0-0_1778024617739_0.6896665713957468","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"@nats-io/nuid","version":"3.0.0","description":"NUID - A highly performant unique identifier generator.","main":"./lib/mod.js","types":"./lib/mod.d.ts","homepage":"https://nats.io/nuid.js","repository":{"type":"git","url":"git+ssh://git@github.com/nats-io/nuid.js.git"},"bugs":{"url":"https://github.com/nats-io/nuid.js/issues"},"license":"Apache-2.0","author":{"name":"The NATS Authors"},"contributors":[],"scripts":{"clean":"rm -rf ./lib ./coverage ./docs","build":"npm run clean && tsc","test":"npm run build && node --test test/basics.js && deno test","doc":"typedoc --out ./docs/ && touch ./docs/.nojekyll","prepack":"npm run clean && npm run build"},"engines":{"node":">= 22.x"},"keywords":["unique","identifier","generator"],"devDependencies":{"typedoc":"0.28.19","typescript":"5.9.3"},"gitHead":"17fbc54370ef2e9ad230012526a8177bc304059a","_id":"@nats-io/nuid@3.0.0","_nodeVersion":"25.9.0","_npmVersion":"11.14.0","dist":{"integrity":"sha512-QbXZDrxmYlrn5AD06gYcUTmEHwxn96HBQMIk7XTjDlEcx6FPzVBBPjp4AMRh1lEv6B4iJ6Xb/Uz61JugPXFRQg==","shasum":"977cb7b999d5dc8df4d9f61aed2d235fcd5259dc","tarball":"https://registry.npmjs.org/@nats-io/nuid/-/nuid-3.0.0.tgz","fileCount":11,"unpackedSize":30670,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@nats-io%2fnuid@3.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDH8WbtOrllKJ837oSDemsVXQVCJABD5F/ePQLRB2OyIAIhANbzzirJkbOfIonYUjyTWxIEsbkSpkOZXCV6Sl/azT9J"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:244669b5-dc83-466d-83ea-abb19a5cdcc7"}},"directories":{},"maintainers":[{"name":"philpennock","email":"npm-packaging@pennock-tech.com"},{"name":"aricart","email":"alberto@synadia.com"},{"name":"derek","email":"derek@nats.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nuid_3.0.0_1778184233953_0.852904597380729"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-25T16:55:46.265Z","modified":"2026-05-07T20:03:54.460Z","2.0.1-2":"2024-06-25T16:55:46.537Z","2.0.1-3":"2024-12-06T20:59:23.502Z","2.0.1":"2024-12-06T21:08:39.113Z","2.0.2":"2025-01-16T21:01:52.009Z","2.0.3":"2025-01-16T23:15:27.637Z","3.0.0-0":"2026-05-05T23:43:37.878Z","3.0.0":"2026-05-07T20:03:54.134Z"},"bugs":{"url":"https://github.com/nats-io/nuid.js/issues"},"author":{"name":"The NATS Authors"},"license":"Apache-2.0","homepage":"https://nats.io/nuid.js","keywords":["unique","identifier","generator"],"repository":{"type":"git","url":"git+ssh://git@github.com/nats-io/nuid.js.git"},"description":"NUID - A highly performant unique identifier generator.","contributors":[],"maintainers":[{"name":"philpennock","email":"npm-packaging@pennock-tech.com"},{"name":"aricart","email":"alberto@synadia.com"},{"name":"derek","email":"derek@nats.io"}],"readme":"# Nuid.js\n\n[![License](https://img.shields.io/badge/Licence-Apache%202.0-blue.svg)](./LICENSE)\n![node](https://github.com/nats-io/nuid.js/actions/workflows/node.yml/badge.svg)\n![deno](https://github.com/nats-io/nuid.js/actions/workflows/deno.yml/badge.svg)\n[![coverage](https://coveralls.io/repos/github/nats-io/nuid.js/badge.svg?branch=main)](https://coveralls.io/github/nats-io/nuid.js?branch=main)\n[![JSDoc](https://img.shields.io/badge/JSDoc-reference-blue)](https://nats-io.github.io/nuid.js)\n\n[![JSR](https://jsr.io/badges/@nats-io/nuid)](https://jsr.io/@nats-io/nuid)\n[![JSR](https://jsr.io/badges/@nats-io/nuid/score)](https://jsr.io/@nats-io/nuid)\n\n[![npm](https://img.shields.io/npm/v/%40nats-io%2Fnuid)](https://www.npmjs.com/package/@nats-io/nuid)\n[![npm](https://img.shields.io/npm/dt/%40nats-io%2Fnuid)](https://www.npmjs.com/package/@nats-io/nuid)\n[![npm](https://img.shields.io/npm/dm/%40nats-io%2Fnuid)](https://www.npmjs.com/package/@nats-io/nuid)\n\nA highly performant unique identifier generator for JavaScript.\n\n## Installation\n\nDeno (via JSR):\n\n```bash\ndeno add jsr:@nats-io/nuid\n```\n\n```typescript\nimport { Nuid, nuid } from \"jsr:@nats-io/nuid\";\n```\n\nNode / Bun (via npm):\n\n```bash\nnpm install @nats-io/nuid\n```\n\n```javascript\n// `nuid` is a shared global instance — call `next()` on it directly.\n// `Nuid` is the class — use `new Nuid()` for an isolated instance.\nconst { nuid, Nuid } = require(\"@nats-io/nuid\");\n// or\nimport { Nuid, nuid } from \"@nats-io/nuid\";\n```\n\n## Basic Usage\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// the prefix is also re-randomized automatically when the sequence\n// counter overflows (i.e. reaches 62^10).\nid = nuid.next();\n```\n\n## Format\n\nA NUID is 22 base-62 ASCII characters from the alphabet `0-9A-Za-z`:\n\n- **12-char prefix** — drawn from `crypto.getRandomValues` (entropy-friendly:\n  one draw per instance, not per id). Per-prefix space is 62^12 ≈ 3.2×10^21.\n- **10-char sequence** — starts at a pseudo-random offset and advances by a\n  pseudo-random increment in `[33, 332]` on each `next()`. The sequence\n  numerically caps at 62^10; combined with the per-instance increment, that\n  yields roughly `62^10 / inc` ids per prefix (~10^15) before the prefix is\n  re-randomized.\n\nTotal identifier space is 62^22 ≈ 2.7×10^39.\n\nOutput format matches the Go `nats-io/nuid` reference — same alphabet, same\nlength — so JS-generated nuids look the same as Go-generated ones.\n\n## Migration\n\nFrom 2.x to 3.x: the public API is unchanged, and output is still 22 chars.\nHowever, generated ids now use the full base-62 alphabet (`0-9A-Za-z`)\nmatching the Go `nats-io/nuid` reference, so any caller that validates,\nstores, or compares against the old uppercase-only `[0-9A-Z]{22}` format\nshould update that logic before upgrading.\n\nThe 3.x version of the npm module supports both CJS and ESM. An ESM-only version\nof the module is available via\n[jsr @nats-io/nuid](https://jsr.io/@nats-io/nuid).\n\n## Supported Node Versions\n\nMinimum supported Node.js version is set in `package.json` (`engines.node`),\ncurrently **>= 22**. The version policy tracks\n[Node.js release support](https://github.com/nodejs/Release): supported floor\nmoves up as older LTS lines reach end-of-life. CI runs against the latest\ncurrent release.\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","readmeFilename":"README.md"}