npm / @paralleldrive/cuid2
@paralleldrive/cuid2
What changed in @paralleldrive/cuid2 2 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-26.
4 breaking1 security3 new APIs and options6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@paralleldrive/cuid2 38 changes
Breaking changes 3
Throws an error when length is greater than 32.
The package now uses ESM instead of CommonJS, so users must use ESM imports or upgrade carefully.
The package adds "type": "module" to package.json as part of its conversion to ES modules.
Security 1
Implements a CSPRNG using crypto.getRandomValues for enhanced security.
Fixes and other changes 4
Replaces export = with named exports to fix TypeScript compilation error TS1203.
Corrects the ./package.json path in the exports field.
Replaces BigInt to provide broader support for legacy browsers.
Adds an export module field for better ESM compatibility.
@paralleldrive/cuid2 26 changes
Breaking changes 1
The package was converted to ES modules, a breaking change; the notes recommend v2.3.1 for CommonJS or v3.0.0+ for ESM.
New APIs and options 3
The release is published with the v2-compat tag for users who need CommonJS.
A CLI was added with help flags.
The CLI includes a shell alias installer.
Fixes and other changes 2
CommonJS compatibility is restored for the v2.x line, providing a non-breaking upgrade path.
Dark mode detection was improved.