unstale

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 init

@unstale/cli on npm

brotli 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.

    2.0.0release notes

  • compress() now returns a Promise<Uint8Array | null> and must be awaited; compression options, output bytes, and null results are unchanged.

    2.0.0release notes

  • 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.0release notes

  • The package is ESM only, and public entry points use named exports with no default export.

    2.0.0release notes

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.

    2.0.0release notes

  • 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.0release notes

Tooling 1

  • TypeScript declarations are added for the package root and standalone modules, including .js aliases and the CompressOptions type.

    2.0.0release notes