Skip to content

eldargab/translit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

License

MIT

About

Text transliteration util

Resources

Stars

Watchers

Forks

Packages

No packages published