Skip to content

Commit 69ac1de

Browse files
committed
Update README
1 parent 5f21acb commit 69ac1de

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ Each codec can also be stream-decoded explicitly with the corresponding method:
9292

9393
## Browser usage
9494

95-
To use this in a browser, you'll need to use a bundler (e.g. Webpack) that can include standard Node.js polyfill packages, you may need to install those polyfill packages, and your bundler needs to support bundling WebAssembly (e.g. Webpack v4+).
95+
This library works in modern browsers that support `CompressionStream`/`DecompressionStream` (all current browsers). Gzip and deflate are handled natively via these APIs, with no polyfills required. Brotli will also use native `CompressionStream('br')` where supported, falling back to `brotli-wasm`.
9696

97-
In Webpack v4 this should all work automatically. In Webpack v5 and most other builders this will require explicit dependencies and configuration. See this package's own [test webpack config](./karma.conf.js#L14-L44) and [dev dependencies](./package.json) for a working example.
97+
Brotli and Zstandard use WebAssembly fallbacks (`brotli-wasm` and `zstd-codec`) when native implementations aren't available. These are loaded on-demand. Your bundler must support WebAssembly (e.g. Webpack v4+).
9898

99-
Brotli and Zstandard are only supported in runtime environments that support WebAssembly. All WebAssembly packages are loaded on-demand and only when native methods (e.g. Node's `zlib.brotli*`) are not available.
99+
A `zlib` polyfill (e.g. `browserify-zlib`) is not required in most environments and can generally be omitted. See this package's own [test webpack config](./karma.conf.js) for a working browser bundling example.

0 commit comments

Comments
 (0)