# What changed in @paralleldrive/cuid2

> 14 changes in @paralleldrive/cuid2 2 to 3 from its official release notes, upgrade guides and advisories: 4 breaking, 1 security, 3 new APIs and options. Each one cited. Sources checked 2026-10-26. HTML: https://unstale.sh/npm/@paralleldrive/cuid2/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @paralleldrive/cuid2 3

### Breaking changes

- Throws an error when length is greater than 32. (3.0.2) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#302---2025-10-27)
- The package now uses ESM instead of CommonJS, so users must use ESM imports or upgrade carefully. (3.0.0) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#300---2025-10-18)
- The package adds "type": "module" to package.json as part of its conversion to ES modules. (3.0.0) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#300---2025-10-18)

### Security

- Implements a CSPRNG using crypto.getRandomValues for enhanced security. (3.0.2) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#302---2025-10-27)

### Fixes and other changes

- Replaces export = with named exports to fix TypeScript compilation error TS1203. (3.3.0) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#330---2026-01-25)
- Corrects the ./package.json path in the exports field. (3.3.0) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#330---2026-01-25)
- Replaces BigInt to provide broader support for legacy browsers. (3.0.2) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#302---2025-10-27)
- Adds an export module field for better ESM compatibility. (3.0.2) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#302---2025-10-27)

## @paralleldrive/cuid2 2

### Breaking changes

- The package was converted to ES modules, a breaking change; the notes recommend v2.3.1 for CommonJS or v3.0.0+ for ESM. (2.3.0) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#230---2025-10-18-deprecated)

### New APIs and options

- The release is published with the v2-compat tag for users who need CommonJS. (2.3.1) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#231---2025-10-24)
- A CLI was added with help flags. (2.3.0) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#230---2025-10-18-deprecated)
- The CLI includes a shell alias installer. (2.3.0) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#230---2025-10-18-deprecated)

### Fixes and other changes

- CommonJS compatibility is restored for the v2.x line, providing a non-breaking upgrade path. (2.3.1) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#231---2025-10-24)
- Dark mode detection was improved. (2.3.0) — [release notes](https://github.com/ericelliott/cuid2/blob/8cbb520b8af00edaf19660796a84cd6c8aa10479/CHANGELOG.md#230---2025-10-18-deprecated)
