A lightweight, dependency-free polyfill that provides reliable TextEncoder/TextDecoder-like encode and decode functions for a small set of encodings, including UTF-8, UTF-16LE, ASCII, Latin-1, and Windows-1252. Useful for JavaScript environments where native text encoding support is limited or inconsistent, such as some React Native Hermes setups or Node.js builds with restricted ICU support.
Project status
- Actively maintained, the repository has had updates in 2025-08, 2025-12, and 2026-03, and there was an upstream push on 2026-06-01 (so it is not quiet or dormant as of 2026-08-12).
- Update cadence appears fairly steady, about 3 to 5 months between the last few versioned updates (v0.2.0 in 2025-08, v0.2.1 in 2025-12, v0.2.2 in 2026-03, with an additional upstream push in 2026-06).
AI summary generated
Recent updates
v0.2.2
v0.2.2 is primarily a bug fix release focused on encoding correctness, with README documentation adjustments. The implementation change is largely contained in the core codec logic (lib/index.ts), plus expanded automated tests to cover malformed input and surrogate edge cases.
v0.2.1
v0.2.1 adds support for the "us-ascii" encoding and includes an optimization to avoid using String.fromCharCode spread when decoding ASCII. The implementation includes additional internal refactors around decoding performance (chunking, cached TextDecoder/TextEncoder instances) that go beyond what the release notes mention.
Featuresv0.2.0
Release v0.2.0 is documented as adding polyfill classes for TextDecoder and TextEncoder, and the README is updated with a broader encoding support table. However, the provided code diff shows no functional implementation changes related to TextDecoder/TextEncoder, and changes appear limited to documentation and package metadata/script adjustments.
Features