any-ascii-json
v0.4.0
Published
Unicode to ASCII transliteration, as JSON.
Maintainers
Readme
This is a fork of any-ascii that exports a generated JSON map of Unicode code points to ASCII equivalents.
AnyAscii JSON
Unicode to ASCII transliteration, as a JSON object.
Converts Unicode characters to their best ASCII representation.
AnyAscii provides ASCII-only replacement strings for practically all Unicode characters. Text is converted character-by-character without considering the context. The mappings for each script are based on popular existing romanization systems. Symbolic characters are converted based on their meaning or appearance. This package emits a sparse JSON map, so code points with no transliteration are omitted from any-ascii.json.
Usage
import anyAsciiJson from 'any-ascii-json';
const s = [...'άνθρωποι'].map(c => anyAsciiJson[c] ?? '').join('');
// "anthropoi"npm install any-ascii-json
Generate the JSON artifact with:
npm run generate