Packages

asn1js

4.1.0 · 19 Nov 2026BSD-3-Clause38.6M / weekRepositoryHomepagenpmAtom feed

Upgrading asn1js From 3.0.0 to 4.1.0

12 releases in betweennotes for 5

Reading releases, release notes and advisories…

Other targets from 3.0.0Newest 3.x3.1.0
  1. 3.0.0yours
  2. 10 releases
  3. 4.0.0major
  4. 4.1.0target
1+
change to make
0
advisories fixed
5+
new
7+
fixes

Counted from 5 of 12 release notes. Advisories are counted from the advisory database, in full.

Before you upgrade

Tick each one off as you go
  • Breaking4.0.0

Release by release

  1. 4.1.0

    19 Nov 20262 new · 3 fixes
    • New

      der: add strict DER decoding and validation helpers

    • New

      oid: add opt-in strict validation and encoding

    • Fixed

      boolean: print the value in toString()

    • Fixed

      oid: optimize base-128 encoding of large components

    • Fixed

      oid: preserve exact values and validate complete strings

  2. 4.0.0

    Migration needed19 Oct 2026
    • Breaking

      asn1js is ESM-only and requires Node.js ^20.19.0 || >=22.12.0 (previously >=12.0.0), so Node.js versions below 20.19 and 22.0-22.11 are no longer supported. The CommonJS build is removed: build/index.js (CommonJS) and build/index.es.js are replaced by a single ES module, build/index.js, with build/index.d.ts, and the new exports map blocks deep imports into build/. CommonJS code can still require("asn1js") on supported Node.js versions through require(esm). TypeScript projects that compile to CommonJS need "module": "node20" or "nodenext". pvtsutils and pvutils are replaced by @peculiar/utils ^4.1. The exported API is unchanged, but new Integer({ value }) and the valueDec setter throw a RangeError for non-integer numbers (v3 truncated them), and encoding a UTCTime with a year outside 1950-2049 throws a RangeError, including new UTCTime({ valueDate }) (v3 wrapped 2050 to 1950; use GeneralizedTime). Integer.fromBigInt encodes negative values correctly, UniversalString encodes characters outside the BMP as single UCS-4 code points (v3 wrote surrogate pairs, which still decode), OID arcs and tag numbers from 2^49 to 2^53 now encode, and an odd-length BMPString or a UniversalString whose length isn't a multiple of 4 returns a decode error instead of throwing. Libraries that check instanceof against asn1js classes (pkijs, @peculiar/asn1-schema) must use the same asn1js major as the application. See "Breaking Changes In v4" in the README.

  3. 3.1.0

    16 Oct 20261 new · 2 fixes
    • New

      Reduce ASN.1 parsing and BER encoding allocations

    • Fixed

      build: Exclude tests from production type checking

    • Fixed

      GeneralizedTime: Omit trailing zeros in fractional seconds (DER)

  4. 3.0.10

    20 Apr 20262 new
    • New

      Added parser limits to asn1js.fromBER() to prevent unbounded BER parsing.

    • New

      Optimized long-form ASN.1 tag parsing to avoid quadratic buffer growth.

  5. 3.0.9no release note

  6. 3.0.7

    9 Dec 20252 fixes
    • Fixed

      Fixed Example to only use asn1js

    • Fixed

      Empty bitstring ber encoding output should be 0x030100

  7. 3.0.1 – 3.0.66 releases, no release note

4 other lines we could not sort, mostly version bumps
  • Migrate test runner from Jest to Vitest

    3.1.0
  • Migrate eslint to oxlint, oxfmt

    3.1.0
  • Update website GitHub Actions and package dependencies

    3.0.7
  • Migrate from Yarn to npm for dependency management

    3.0.7

52 internal lines (docs, tests, tooling) left out.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.