You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Less than half the bundle size of [text-encoding](https://npmjs.com/text-encoding), [whatwg-encoding](https://npmjs.com/whatwg-encoding) or [iconv-lite](https://npmjs.com/iconv-lite) (gzipped or not), and [is much faster](#fast).
37
-
See also [lite version](#lite-version).
36
+
Less than half the bundle size of [text-encoding](https://npmjs.com/text-encoding), [whatwg-encoding](https://npmjs.com/whatwg-encoding) or [iconv-lite](https://npmjs.com/iconv-lite) (gzipped or not), also [much faster](#fast).
38
37
39
-
Spec compliant, passing WPT and covered with extra tests.
38
+
> [!TIP]
39
+
> See also the [lite version](#lite-version) for a 9 KiB gzipped polyfill.
40
40
41
-
Moreover, tests for this library uncovered [bugs in all major implementations](https://docs.google.com/spreadsheets/d/1pdEefRG6r9fZy61WHGz0TKSt8cO4ISWqlpBN5KntIvQ/edit).
42
-
43
-
[Faster than Node.js native implementation on Node.js](https://github.com/nodejs/node/issues/61041#issuecomment-3649242024).
41
+
Spec compliant, passing WPT and covered with extra tests.\
42
+
Moreover, tests for this library uncovered [bugs in all major implementations](https://docs.google.com/spreadsheets/d/1pdEefRG6r9fZy61WHGz0TKSt8cO4ISWqlpBN5KntIvQ/edit).\
43
+
It works correctly even in environments that have native implementations broken (and that's all environments currently).\
44
44
Runs (and passes WPT) on Node.js built without ICU.
45
45
46
+
> [!NOTE]
47
+
> [Faster than Node.js native implementation on Node.js](https://github.com/nodejs/node/issues/61041#issuecomment-3649242024).\
48
+
> The JS multi-byte version is as fast as native impl in Node.js and browsers, but (unlike them) returns correct results.\
49
+
> For encodings where native version is known to be fast and correct, it is automatically used.\
50
+
> Some single-byte encodings are (somewhy) faster than native in all three major browser engines.
51
+
52
+
See [analysis table](https://docs.google.com/spreadsheets/d/1pdEefRG6r9fZy61WHGz0TKSt8cO4ISWqlpBN5KntIvQ/edit) for more info.
53
+
46
54
### Caveat: `TextDecoder` / `TextEncoder` APIs are lossy by default per spec
47
55
48
56
_These are only provided as a compatibility layer, prefer hardened APIs instead in new code._
0 commit comments