# What changed in brotli

> 7 changes in brotli 2 from its official release notes, upgrade guides and advisories: 4 breaking. Each one cited. Sources checked 2026-10-27. HTML: https://unstale.sh/npm/brotli/

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

## brotli 2

### Breaking changes

- Public entry points are limited to the package root and standalone compress and decompress modules; standalone modules export their named function and have .js aliases. (2.0.0) — [release notes](https://github.com/devongovett/brotli.js/blob/57c43c5626c427b51c53f6eb42a6b48a5f5b9615/CHANGELOG.md#200---2026-10-10)
- compress() now returns a Promise<Uint8Array | null> and must be awaited; compression options, output bytes, and null results are unchanged. (2.0.0) — [release notes](https://github.com/devongovett/brotli.js/blob/57c43c5626c427b51c53f6eb42a6b48a5f5b9615/CHANGELOG.md#200---2026-10-10)
- Initialization is deferred until the first compression call; concurrent calls share one initialization Promise, failures are not retried automatically, and initialization or runtime errors reject the compression Promise. (2.0.0) — [release notes](https://github.com/devongovett/brotli.js/blob/57c43c5626c427b51c53f6eb42a6b48a5f5b9615/CHANGELOG.md#200---2026-10-10)
- The package is ESM only, and public entry points use named exports with no default export. (2.0.0) — [release notes](https://github.com/devongovett/brotli.js/blob/57c43c5626c427b51c53f6eb42a6b48a5f5b9615/CHANGELOG.md#200---2026-10-10)

### Behavior and default changes

- Encoding still runs without workers; input, options, and dictionary must remain unchanged until compression settles, and input copying is not added. (2.0.0) — [release notes](https://github.com/devongovett/brotli.js/blob/57c43c5626c427b51c53f6eb42a6b48a5f5b9615/CHANGELOG.md#200---2026-10-10)
- Modern Node.js require() works through every public entry point; unflagged ESM loading is supported in Node 20.19+, 22.12+, and later, while the distribution remains ESM only. (2.0.0) — [release notes](https://github.com/devongovett/brotli.js/blob/57c43c5626c427b51c53f6eb42a6b48a5f5b9615/CHANGELOG.md#200---2026-10-10)

### Tooling

- TypeScript declarations are added for the package root and standalone modules, including .js aliases and the CompressOptions type. (2.0.0) — [release notes](https://github.com/devongovett/brotli.js/blob/57c43c5626c427b51c53f6eb42a6b48a5f5b9615/CHANGELOG.md#200---2026-10-10)
