npm / pako
pako
What changed in pako 2 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-12.
11 breaking4 new APIs and options2 performance1 tooling7 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpako 319 changes
Breaking changes 9
The Uint8Array type is narrowed to ArrayBuffer only.
Inflate no longer collects gzip headers automatically; use
.onStart()withzlibInflateGetHeader()to read gzip metadata.The option now accepts only Uint8Array or ArrayBuffer; String is no longer accepted.
High-level helpers use
{ toText: true }instead of{ to: 'string' }for UTF-8 text output.Calling Inflate.push() after stream end returns the decode result instead of always returning false.
The default is now false, making binary output compatible with nodejs by default.
Now only assembles output chunks into result and no longer sets the err or msg fields.
Package files layout changed; consult package.json for supported entry points.
String conversion now uses native TextEncoder and TextDecoder; shims were removed.
New APIs and options 3
Exports the Z_Strategy type for compression strategy options.
Adds hooks for advanced stream setup.
Low-level zlib API exports are now available.
Performance 1
Speeds up CRC32 using slicing-by-8.
Tooling 1
Generated type definitions are now available.
Fixes and other changes 5
Restores compression strategy constant exports.
Enforces the 65536-character limit when collecting gzip header names and comments.
Gzip header time is read as an unsigned 32-bit value, fixing negative timestamps from 2038 onward.
Block type selection with Z_FIXED avoids fixed blocks when stored blocks would be smaller.
A Z_STREAM_ERROR check was added for a condition reachable only through a wrong options call.
pako 26 changes
Breaking changes 2
Inflate continues to the next stream only for gzip.
Inflate errors on truncated input.
New APIs and options 1
Adds a deflate option, defaulting to true, to switch between original zlib and nodejs binary-compatible output.
Performance 1
An alternate deflate hash provides nodejs zlib-compatible output and about a 40% speed boost.
Fixes and other changes 2
Inflate now emits a chunk on flush.
Fixes the inflate window not being updated after inflateReset, including for multistream and bgzip.