@@ -107,8 +107,19 @@ import { TextDecoderStream, TextEncoderStream } from '@exodus/bytes/encoding-lit
107107```
108108
109109This reduces the bundle size 9x:\
110- from 90 KiB gzipped for ` @exodus/bytes/encoding.js ` to 10 KiB gzipped for ` @exodus/bytes/encoding-lite.js ` .\
111- (For comparison, ` text-encoding ` module is 190 KiB gzipped, and ` iconv-lite ` is 194 KiB gzipped):
110+ from 94 KiB gzipped for ` @exodus/bytes/encoding.js ` to 10 KiB gzipped for ` @exodus/bytes/encoding-lite.js ` .\
111+ (For comparison, ` text-encoding ` and ` iconv-lite ` are each over 195 KiB gzipped):
112+
113+ | import | size |
114+ | - | - |
115+ | ` @exodus/bytes/encoding-browser.js ` | <sub >![ ] ( https://img.shields.io/bundlejs/size/@exodus/bytes/encoding-browser.js?style=flat-square ) </sub > |
116+ | ` @exodus/bytes/encoding-lite.js ` | <sub >![ ] ( https://img.shields.io/bundlejs/size/@exodus/bytes/encoding-lite.js?style=flat-square ) </sub > |
117+ | ` @exodus/bytes/encoding.js ` | <sub >![ ] ( https://img.shields.io/bundlejs/size/@exodus/bytes/encoding.js?style=flat-square ) </sub > |
118+ | ` text-encoding ` | <sub >![ ] ( https://img.shields.io/bundlejs/size/text-encoding?style=flat-square ) </sub > |
119+ | ` iconv-lite ` | <sub >![ ] ( https://img.shields.io/bundlejs/size/iconv-lite?style=flat-square ) </sub > |
120+ | ` whatwg-encoding ` | <sub >![ ] ( https://img.shields.io/bundlejs/size/whatwg-encoding?style=flat-square ) </sub > |
121+
122+ _ Numbers differ a bit because compression differs._
112123
113124It still supports ` utf-8 ` , ` utf-16le ` , ` utf-16be ` and all single-byte encodings specified by the spec,
114125the only difference is support for legacy multi-byte encodings.
@@ -667,7 +678,7 @@ Create a view of a TypedArray in the specified format (`'uint8'` or `'buffer'`)
667678> [ !IMPORTANT]
668679> Does not copy data, returns a view on the same underlying buffer
669680
670- ### @exodus/bytes /encoding.js
681+ ### @exodus/bytes /encoding.js < sub > ![ ] ( https://img.shields.io/bundlejs/size/@exodus/bytes/encoding.js?style=flat-square ) </ sub >
671682
672683Implements the [ Encoding standard] ( https://encoding.spec.whatwg.org/ ) :
673684[ TextDecoder] ( https://encoding.spec.whatwg.org/#interface-textdecoder ) ,
@@ -778,7 +789,7 @@ only expects lowercased encoding name:
778789new TextDecoder (getBOMEncoding (input) ?? fallbackEncoding).decode (input)
779790` ` `
780791
781- ### @exodus/bytes/encoding-lite.js
792+ ### @exodus/bytes/encoding-lite.js <sub></sub>
782793
783794The exact same exports as ` @exodus/ bytes/ encoding .js ` are also exported as
784795` @exodus/ bytes/ encoding- lite .js ` , with the difference that the lite version does not load
837848' %'
838849` ` `
839850
840- ### @exodus/bytes/encoding-browser.js
851+ ### @exodus/bytes/encoding-browser.js <sub><sub>
841852
842853Same as ` @exodus/ bytes/ encoding .js ` , but in browsers instead of polyfilling just uses whatever the
843854browser provides, drastically reducing the bundle size (to less than 2 KiB gzipped).
0 commit comments