Text transliteration util.
via component
component install eldargab/translit
via npm
npm install translit
var translit = require('translit')({
'И': 'I',
'ж': 'zh',
'е': 'e'
'в': 'v',
'c': 's',
'к': 'k'
})
translit('Ижевск') //=> Izhevsk
Or vice versa
var translit = require('translit')({
'I': 'И',
'zh': 'ж'
})
translit('Izh') //=> Иж
You can also provide fallback function for replacing unknown characters
var translit = require('translit')({}, {
fallback: char => char.toUpperCase()
})
translit('hello') //=> HELLO
- translit-russian - Russian transliteration map
MIT