unstale

npm / pbf

pbf

What changed in pbf 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.

3 breaking2 security1 new APIs and options4 performance3 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

pbf 512 changes

Breaking changes 3

  • The Pbf class is split into PbfReader and PbfWriter classes, allowing bundlers to tree-shake the half you don't use.

    5.0.0release notes

  • The Pbf class is split into PbfReader and PbfWriter classes, allowing bundlers to tree-shake the half you don't use.

    5.0.0release notes

  • The legacy readVarint64 method is removed; use readVarint(true) for signed 64-bit reads.

    5.0.0release notes

Security 1

  • Fixes a minor compiler vulnerability that could allow code injection via an unsafe schema.

    5.1.2release notes

New APIs and options 1

  • Added PbfReader.nextField(end) for more compact, readable, and bulletproof decoding while preserving performance.

    5.1.0release notes

Performance 4

  • A fast path improves performance by 20% on the vector tiles encoding benchmark.

    5.1.1release notes

  • A single-byte fast path improves performance for the common case, including tags and small integers.

    5.0.0release notes

  • Uses typedArray.set instead of a manual copy loop.

    5.0.0release notes

  • A single-byte fast path improves performance for the common case, including tags and small integers.

    5.0.0release notes

Fixes and other changes 3

  • Now honors a non-zero byteOffset of the backing buffer.

    5.1.1release notes

  • Now honors a non-zero byteOffset of the backing buffer.

    5.1.1release notes

  • Fixes a bug in compiled packed sfixed64 fields.

    5.0.0release notes

pbf 41 changes

Security 1

  • Field names are sanitized to protect against injection via malicious proto schemas.

    4.0.2release notes