npm / @peculiar/x509
@peculiar/x509
What changed in @peculiar/x509 1 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-27.
9 breaking3 new APIs and options1 performance1 behavior and defaults3 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@peculiar/x509 38 changes
Breaking changes 8
The browser script exposing the x509 global is removed; browsers should use the ESM build through a bundler or esm.sh, or pin version 2 for the old script.
Input with trailing bytes after the encoded ASN.1 structure now throws an error instead of being accepted with the extra bytes kept in rawData.
TypeScript projects compiling to CommonJS need module set to node20 or nodenext; node16 fails with TS1479.
The supported versions are ^20.19.0 || >=22.12.0; Node.js 20.0-20.18 and 22.0-22.11 cannot use CommonJS require(esm).
Deep imports are blocked by package exports, so consumers must use supported package entry points.
Version ^3.0.0 is a peer dependency; ASN.1 objects from asn1-schema 2 packages can no longer be passed in.
The package is ESM-only; CommonJS require works only on supported Node.js versions through require(esm).
The unpkg and jsdelivr package fields are removed along with the browser script.
@peculiar/x509 27 changes
Breaking changes 1
The reflect polyfill is now required.
New APIs and options 3
ASN.1 parse options are exposed for developers to use.
A crypto argument is added to findRevoked.
AlgorithmProvider handlers are registered for ML-DSA and SLH-DSA, adding support for FIPS 204 and FIPS 205 algorithms.
Performance 1
PEM encoding and decoding are optimized for performance.
Fixes and other changes 2
Limits are no longer applied when parsing the library's own DER.
Revoked serial numbers in CRLs are encoded as positive INTEGERs.
@peculiar/x509 12 changes
Behavior and default changes 1
The minimum supported Node.js version was lowered from >=22.0.0 to >=20.0.0, allowing developers to use the package with Node.js 20 and newer.
Fixes and other changes 1
Fixes passing crypto.