Skip to content

v2.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Oct 09:12
c566ac9

2.0.0 (2026-10-27)

⚠ BREAKING CHANGES

  • PemConverter is no longer exported. Use pem from @peculiar/utils/pem: decodeFirst instead of toArrayBuffer/toUint8Array, encode instead of fromBufferSource (label used as given, output ends with a newline), and decode/find instead of isPEM, getTagName, hasTagName and the is* checks (labels compare case-sensitively).
  • deps: BufferSourceConverter is no longer exported. Use toArrayBuffer, toUint8Array, isBufferSource, equal (was isEqual) and concat from @peculiar/utils/bytes instead.
  • deps: @peculiar/asn1-schema ^3.0.0, @peculiar/json-schema ^3.0.0 and asn1js ^4.0.0 are peer dependencies (1.9.2 depended on ^2.7.0, ^1.1.12 and ^3.0.10), and @peculiar/utils moves from ^2.0.2 to ^4.1.0. webcrypto-core registers its ASN.1 and JWK classes in the schema storages of asn1-schema and json-schema, so an app needs exactly one copy of each; npm 7+ installs peers automatically, and a conflicting major now fails at install (ERESOLVE) instead of at runtime. Libraries on the older majors (@peculiar/webcrypto 1, @peculiar/x509 2) have to move together.
  • webcrypto-core is ESM-only and requires Node.js ^20.19.0 || >=22.12.0 (1.x declared no range). The CommonJS and ES bundles build/webcrypto-core.js and build/webcrypto-core.es.js are replaced by unbundled ES modules with build/index.js and build/index.d.ts as the entry point; the exports map still blocks deep imports into build/. CommonJS code can still require("webcrypto-core") on supported Node.js versions through require(esm), and require() and import now load the same module, so CryptoKey instanceof checks and EcCurves registrations work across both. TypeScript projects that compile to CommonJS need "module": "node20" or "nodenext". See "Breaking Changes In v2" in the README.

Features

  • remove PemConverter in favor of @peculiar/utils/pem (#86) (2b58978)

Build System

  • deps: move asn1-schema, json-schema and asn1js to peer dependencies (#81) (4509338)
  • deps: stop re-exporting BufferSourceConverter from @peculiar/utils/legacy (#84) (ae3337a)
  • migrate to tsdown, upgrade deps, colocate vitest specs, adopt CI workflows (#75) (e96c274)
  • ship ESM-only output for Node.js ^20.19.0 || >=22.12.0 (#80) (be5efbc)