A pure JavaScript library for converting character encodings with no native dependencies.
iconv-lite is a pure JavaScript library for converting text between different character encodings. It solves the problem of handling multilingual text data in Node.js and browser environments without relying on native code compilation. The library supports a wide range of encodings, from UTF-8 and Windows code pages to Asian character sets like GBK and Shift_JIS.
Node.js developers working with internationalization, data processing pipelines, or legacy systems requiring encoding conversion. It's also suitable for frontend developers needing encoding support in bundled web applications.
Developers choose iconv-lite for its zero-dependency pure JavaScript implementation, which ensures compatibility across platforms and avoids native compilation issues. It outperforms native alternatives in speed while providing a comprehensive encoding suite and streaming API.
Convert character encodings in pure javascript.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
No native code compilation required, ensuring quick installation and compatibility across Windows, web, and sandboxed environments, as highlighted in the README.
Benchmarks show it outperforms node-iconv, with encode speeds up to ~320 Mb/s for win1251, making it efficient for data-intensive tasks.
Covers all Node.js native encodings, Unicode variants, single-byte families like ISO-8859, and multibyte encodings such as GBK and Shift_JIS, as listed in the supported encodings.
Supports pipe-based workflows for handling large data streams, demonstrated in HTTP server and file conversion examples in the usage section.
Works in browsers via bundlers like Webpack and supports React Native with additional modules, enabling versatile deployment options.
Untranslatable characters are replaced with placeholders (� or ?), leading to potential data loss in applications requiring precise character mapping, as admitted in the README.
Automatic BOM detection is limited to UTF encodings; for others, modules like node-autodetect-decoder-stream are needed, adding complexity and dependencies.
Decoding must use Buffer objects, or errors occur—a common source of bugs emphasized in the wiki and README warnings.
For UTF-16 and UTF-32, it relies on heuristics and BOM, which might not always be accurate, requiring manual overrides and careful configuration.