A tiny, fast, modern production‑grade ID generator designed for every JavaScript runtime — Node, Bun, Deno, browsers, edge runtimes, and more. Zero dependencies, instant startup, and a clean API.
import idtools from "jsr:@idtools/prod"; // import from "@idtools/prod" when installed with "npx jsr add @idtools/prod" OR "pnpm install jsr:@idtools/prod"
// NanoID
idtools.nanoid.production() // --> generates a secure nanoid
idtools.nanoid.nonSecure() // --> generates a non-secure* nanoid, not recommended for production
// UUID
idtools.uuid.v1() // --> generates a UUID V1
idtools.uuid.v3() // --> generates a UUID V3
idtools.uuid.v4() // --> generates a UUID V4
idtools.uuid.v5() // --> generates a UUID V5
idtools.uuid.NIL // --> exposes the NIL
// randomNumber
idtools.randomNumber() // --> generates a cryptographically secure random number
// iso-timestamp
idtools.isoTimestamp() // --> returns the current ISO-8601 timestampSee https://jsr.io/@idtools/prod for installation steps.
If you want to try new features before they land in production — and don’t mind occasional bugs — check out the Insiders build: https://jsr.io/@idtools/insiders
Thanks to github.com/ai and github.com/uuidjs for the respective
nanoidanduuidlibraries!