@@ -106,8 +106,19 @@ import { TextDecoderStream, TextEncoderStream } from '@exodus/bytes/encoding-lit
106106```
107107
108108This reduces the bundle size 9x:\
109- from 90 KiB gzipped for ` @exodus/bytes/encoding.js ` to 10 KiB gzipped for ` @exodus/bytes/encoding-lite.js ` .\
110- (For comparison, ` text-encoding ` module is 190 KiB gzipped, and ` iconv-lite ` is 194 KiB gzipped):
109+ from 94 KiB gzipped for ` @exodus/bytes/encoding.js ` to 10 KiB gzipped for ` @exodus/bytes/encoding-lite.js ` .\
110+ (For comparison, ` text-encoding ` and ` iconv-lite ` are each over 195 KiB gzipped):
111+
112+ | import | size |
113+ | - | - |
114+ | ` @exodus/bytes/encoding-browser.js ` | ![ ] ( https://img.shields.io/bundlejs/size/@exodus/bytes/encoding-browser.js?style=flat-square ) |
115+ | ` @exodus/bytes/encoding-lite.js ` | ![ ] ( https://img.shields.io/bundlejs/size/@exodus/bytes/encoding-lite.js?style=flat-square ) |
116+ | ` @exodus/bytes/encoding.js ` | ![ ] ( https://img.shields.io/bundlejs/size/@exodus/bytes/encoding.js?style=flat-square ) |
117+ | ` text-encoding ` | ![ ] ( https://img.shields.io/bundlejs/size/text-encoding?style=flat-square ) |
118+ | ` iconv-lite ` | ![ ] ( https://img.shields.io/bundlejs/size/iconv-lite?style=flat-square ) |
119+ | ` whatwg-encoding ` | ![ ] ( https://img.shields.io/bundlejs/size/whatwg-encoding?style=flat-square ) |
120+
121+ _ Numbers differ a bit because compression differs._
111122
112123It still supports ` utf-8 ` , ` utf-16le ` , ` utf-16be ` and all single-byte encodings specified by the spec,
113124the 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'`)
668679
669680### @exodus/bytes /encoding.js
670681
682+ ![ ] ( https://img.shields.io/bundlejs/size/@exodus/bytes/encoding.js?style=flat-square )
683+
671684Implements the [ Encoding standard] ( https://encoding.spec.whatwg.org/ ) :
672685[ TextDecoder] ( https://encoding.spec.whatwg.org/#interface-textdecoder ) ,
673686[ TextEncoder] ( https://encoding.spec.whatwg.org/#interface-textencoder ) ,
@@ -779,6 +792,8 @@ new TextDecoder(getBOMEncoding(input) ?? fallbackEncoding).decode(input)
779792
780793### @exodus/bytes/encoding-lite.js
781794
795+ 
796+
782797The exact same exports as ` @exodus/ bytes/ encoding .js ` are also exported as
783798` @exodus/ bytes/ encoding- lite .js ` , with the difference that the lite version does not load
784799multi-byte ` TextDecoder` encodings by default to reduce bundle size 10x.
838853
839854### @exodus/bytes/encoding-browser.js
840855
856+ 
857+
841858Same as ` @exodus/ bytes/ encoding .js ` , but in browsers instead of polyfilling just uses whatever the
842859browser provides, drastically reducing the bundle size (to less than 2 KiB gzipped).
843860
0 commit comments