diff --git a/README.md b/README.md index d51b1c8..b840c3a 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,17 @@ This reduces the bundle size 9x:\ from 90 KiB gzipped for `@exodus/bytes/encoding.js` to 10 KiB gzipped for `@exodus/bytes/encoding-lite.js`.\ (For comparison, `text-encoding` module is 190 KiB gzipped, and `iconv-lite` is 194 KiB gzipped): +| import | size | +| - | - | +| `@exodus/bytes/encoding-browser.js` | ![](https://img.shields.io/bundlejs/size/@exodus/bytes/encoding-browser.js?style=flat-square) | +| `@exodus/bytes/encoding-lite.js` | ![](https://img.shields.io/bundlejs/size/@exodus/bytes/encoding-lite.js?style=flat-square) | +| `@exodus/bytes/encoding.js` | ![](https://img.shields.io/bundlejs/size/@exodus/bytes/encoding.js?style=flat-square) | +| `text-encoding` | ![](https://img.shields.io/bundlejs/size/text-encoding?style=flat-square) | +| `iconv-lite` | ![](https://img.shields.io/bundlejs/size/iconv-lite?style=flat-square) | +| `whatwg-encoding` | ![](https://img.shields.io/bundlejs/size/whatwg-encoding?style=flat-square) | + +_Numbers differ a bit because compression differs._ + It still supports `utf-8`, `utf-16le`, `utf-16be` and all single-byte encodings specified by the spec, the only difference is support for legacy multi-byte encodings. @@ -668,6 +679,8 @@ Create a view of a TypedArray in the specified format (`'uint8'` or `'buffer'`) ### @exodus/bytes/encoding.js +![](https://img.shields.io/bundlejs/size/@exodus/bytes/encoding.js?style=flat-square) + Implements the [Encoding standard](https://encoding.spec.whatwg.org/): [TextDecoder](https://encoding.spec.whatwg.org/#interface-textdecoder), [TextEncoder](https://encoding.spec.whatwg.org/#interface-textencoder), @@ -779,6 +792,8 @@ new TextDecoder(getBOMEncoding(input) ?? fallbackEncoding).decode(input) ### @exodus/bytes/encoding-lite.js +![](https://img.shields.io/bundlejs/size/@exodus/bytes/encoding-lite.js?style=flat-square) + The exact same exports as `@exodus/bytes/encoding.js` are also exported as `@exodus/bytes/encoding-lite.js`, with the difference that the lite version does not load multi-byte `TextDecoder` encodings by default to reduce bundle size 10x. @@ -838,6 +853,8 @@ true ### @exodus/bytes/encoding-browser.js +![](https://img.shields.io/bundlejs/size/@exodus/bytes/encoding-browser.js?style=flat-square) + Same as `@exodus/bytes/encoding.js`, but in browsers instead of polyfilling just uses whatever the browser provides, drastically reducing the bundle size (to less than 2 KiB gzipped).