@@ -107,8 +107,17 @@ 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 > |
112121
113122It still supports ` utf-8 ` , ` utf-16le ` , ` utf-16be ` and all single-byte encodings specified by the spec,
114123the only difference is support for legacy multi-byte encodings.
@@ -667,7 +676,7 @@ Create a view of a TypedArray in the specified format (`'uint8'` or `'buffer'`)
667676> [ !IMPORTANT]
668677> Does not copy data, returns a view on the same underlying buffer
669678
670- ### @exodus/bytes /encoding.js
679+ ### @exodus/bytes /encoding.js < sub > ![ ] ( https://img.shields.io/bundlejs/size/@exodus/bytes/encoding.js?style=flat-square ) </ sub >
671680
672681Implements the [ Encoding standard] ( https://encoding.spec.whatwg.org/ ) :
673682[ TextDecoder] ( https://encoding.spec.whatwg.org/#interface-textdecoder ) ,
@@ -778,7 +787,7 @@ only expects lowercased encoding name:
778787new TextDecoder (getBOMEncoding (input) ?? fallbackEncoding).decode (input)
779788` ` `
780789
781- ### @exodus/bytes/encoding-lite.js
790+ ### @exodus/bytes/encoding-lite.js <sub></sub>
782791
783792The exact same exports as ` @exodus/ bytes/ encoding .js ` are also exported as
784793` @exodus/ bytes/ encoding- lite .js ` , with the difference that the lite version does not load
837846' %'
838847` ` `
839848
840- ### @exodus/bytes/encoding-browser.js
849+ ### @exodus/bytes/encoding-browser.js <sub><sub>
841850
842851Same as ` @exodus/ bytes/ encoding .js ` , but in browsers instead of polyfilling just uses whatever the
843852browser provides, drastically reducing the bundle size (to less than 2 KiB gzipped).
0 commit comments