npm / js-base64
js-base64
What changed in js-base64 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-28.
2 breaking2 performance4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initjs-base64 38 changes
Breaking changes 2
isValid() now returns false for data lengths of 4n+1, which cannot encode a whole number of bytes.
btoa() now throws on non-Latin1 input on the Buffer code path as well.
Performance 2
toUint8Array() is faster on platforms without Uint8Array.fromBase64 because bytes are written straight into the resulting Uint8Array.
The library uses the native method where available.
Fixes and other changes 4
No longer causes infinite recursion on platforms with native Uint8Array.prototype.toBase64.
The return type is narrowed to an ArrayBuffer-backed Uint8Array, allowing the result to be used where a BufferSource is expected, such as Web Crypto and Blob.
Corrected a typo in the low-surrogate range, fixing UTF-8 encoding behavior.
decode() preserves a leading BOM (U+FEFF) on the TextDecoder code path.