npm / brotli
brotli
What changed in brotli 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-27.
4 breaking2 behavior and defaults1 tooling
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initbrotli 27 changes
Breaking changes 4
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.
compress() now returns a Promise<Uint8Array | null> and must be awaited; compression options, output bytes, and null results are unchanged.
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.
The package is ESM only, and public entry points use named exports with no default export.
Behavior and default changes 2
Encoding still runs without workers; input, options, and dictionary must remain unchanged until compression settles, and input copying is not added.
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.
Tooling 1
TypeScript declarations are added for the package root and standalone modules, including .js aliases and the CompressOptions type.