# What changed in pako

> 25 changes in pako 2 to 3 from its official release notes, upgrade guides and advisories: 11 breaking, 4 new APIs and options. Each one cited. Sources checked 2026-11-12. HTML: https://unstale.sh/npm/pako/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## pako 3

### Breaking changes

- The Uint8Array type is narrowed to ArrayBuffer only. (3.0.1) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#301---2026-07-06)
- Inflate no longer collects gzip headers automatically; use `.onStart()` with `zlibInflateGetHeader()` to read gzip metadata. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)
- The option now accepts only Uint8Array or ArrayBuffer; String is no longer accepted. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)
- High-level helpers use `{ toText: true }` instead of `{ to: 'string' }` for UTF-8 text output. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)
- Calling Inflate.push() after stream end returns the decode result instead of always returning false. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)
- The default is now false, making binary output compatible with nodejs by default. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)
- Now only assembles output chunks into result and no longer sets the err or msg fields. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)
- Package files layout changed; consult package.json for supported entry points. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)
- String conversion now uses native TextEncoder and TextDecoder; shims were removed. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)

### New APIs and options

- Exports the Z_Strategy type for compression strategy options. (3.0.3) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#303---2026-10-26)
- Adds hooks for advanced stream setup. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)
- Low-level zlib API exports are now available. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)

### Performance

- Speeds up CRC32 using slicing-by-8. (3.0.3) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#303---2026-10-26)

### Tooling

- Generated type definitions are now available. (3.0.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#300---2026-06-26)

### Fixes and other changes

- Restores compression strategy constant exports. (3.0.3) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#303---2026-10-26)
- Enforces the 65536-character limit when collecting gzip header names and comments. (3.0.3) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#303---2026-10-26)
- Gzip header time is read as an unsigned 32-bit value, fixing negative timestamps from 2038 onward. (3.0.2) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#302---2026-09-12)
- Block type selection with Z_FIXED avoids fixed blocks when stored blocks would be smaller. (3.0.2) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#302---2026-09-12)
- A Z_STREAM_ERROR check was added for a condition reachable only through a wrong options call. (3.0.1) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#301---2026-07-06)

## pako 2

### Breaking changes

- Inflate continues to the next stream only for gzip. (2.2.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#220---2026-06-22)
- Inflate errors on truncated input. (2.2.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#220---2026-06-22)

### New APIs and options

- Adds a deflate option, defaulting to true, to switch between original zlib and nodejs binary-compatible output. (2.2.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#220---2026-06-22)

### Performance

- An alternate deflate hash provides nodejs zlib-compatible output and about a 40% speed boost. (2.2.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#220---2026-06-22)

### Fixes and other changes

- Inflate now emits a chunk on flush. (2.2.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#220---2026-06-22)
- Fixes the inflate window not being updated after inflateReset, including for multistream and bgzip. (2.2.0) — [release notes](https://github.com/nodeca/pako/blob/d0101a9cf08e5260d962e47d1a095f530231e61d/CHANGELOG.md#220---2026-06-22)
