translit
v0.1.0
Published
Text transliteration util
Downloads
1,146
Readme
translit
Text transliteration util.
Installation
via component
component install eldargab/translit
via npm
npm install translit
Example
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
Related
- translit-russian - Russian transliteration map
License
MIT