text-unidecode
v1.1.6
Published
Unicode to ASCII transliteration (Text::Unidecode-style): slugs, logs, search, strip diacritics, romanization approximation for Node.js
Downloads
242
Maintainers
Readme
text-unidecode
text-unidecode converts Unicode text into an ASCII-heavy, human-readable approximation (rough transliteration). It is useful for slugs, logs, search indexes, and anywhere you need a plain-ASCII stand-in for arbitrary Unicode.
Maintained by Muhammad Ali. Repository: github.com/maliuppal/text-unidecode.
Install
npm install text-unidecodeUsage
const unidecode = require('text-unidecode');
unidecode('aéà)àçé');
// => 'aea)ace'
unidecode('に間違いがないか、再度確認してください。再読み込みしてください。');
// => 'niJian Wei iganaika, Zai Du Que Ren sitekudasai. Zai Du miIp misitekudasai. 'Custom replacement for unmappable characters
unidecode('ab\uFFFFc', 'X');
// => 'abXc'
unidecode('ab\uFFFFc');
// => 'abc'Package layout
| Path | Purpose |
|------|---------|
| lib/unidecode.js | Entry point |
| data/x*.js | Per–Unicode-block lookup tables |
Changelog
See CHANGELOG.md.
License
This project is licensed under the MIT License.
Transliteration data and incorporated third-party code are described in THIRD-PARTY-NOTICES.md.
Donate
I maintain this project in my free time. If it helped you, please support my work via PayPal. Thanks a lot!
