cyrillic-to-translit-js

WebJar for cyrillic-to-translit-js

License

License

MIT
Categories

Categories

JavaScript Languages
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

cyrillic-to-translit-js
Last Version

Last Version

3.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

cyrillic-to-translit-js
WebJar for cyrillic-to-translit-js
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/greybax/cyrillic-to-translit-js

Download cyrillic-to-translit-js

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/cyrillic-to-translit-js/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>cyrillic-to-translit-js</artifactId>
    <version>3.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/cyrillic-to-translit-js/
implementation 'org.webjars.npm:cyrillic-to-translit-js:3.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/cyrillic-to-translit-js/
implementation ("org.webjars.npm:cyrillic-to-translit-js:3.1.0")
'org.webjars.npm:cyrillic-to-translit-js:jar:3.1.0'
<dependency org="org.webjars.npm" name="cyrillic-to-translit-js" rev="3.1.0">
  <artifact name="cyrillic-to-translit-js" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='cyrillic-to-translit-js', version='3.1.0')
)
libraryDependencies += "org.webjars.npm" % "cyrillic-to-translit-js" % "3.1.0"
[org.webjars.npm/cyrillic-to-translit-js "3.1.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : browserify jar [16.5.0,17)
org.webjars.npm : lodash.invert jar [4.3.0,5)

Project Modules

There are no modules declared in this project.

cyrillic-to-translit-js

Codeship Status for greybax/cyrillic-to-translit-js

NPM version NPM Downloads/month Build Status Coveralls Status

Ultra-lightweight JavaScript library for converting Cyrillic symbols to Translit and vice versa

Demo page

Install

npm install --save cyrillic-to-translit-js

Simple to use

import CyrillicToTranslit from 'cyrillic-to-translit-js';

const cyrillicToTranslit = new CyrillicToTranslit();

cyrillicToTranslit.transform('Какая-то строка', '_').toLowerCase();

Constructor

  • { preset: ru } or empty - transliteration preset for Russian language.
  • { preset: uk } - transliteration preset for Ukranian language (see PR #27).

transform()

Convert Cyrillic symbols to Translit

cyrillicToTranslit().transform(input, spaceReplacement);

  • input - string which should be transformed
  • spaceReplacement - symbol for space replacement

reverse()

Convert Translit symbols to Cyrillic

cyrillicToTranslit().reverse(input, spaceReplacement);

  • input - string which should be transformed
  • spaceReplacement - symbol for space replacement

Examples

  • transform()
  cyrillicToTranslit().transform('Привет Мир!');

  >Privet Mir!
  cyrillicToTranslit().transform('привет мир!', "_")

  >privet_mir!
  cyrillicToTranslit({ preset: "uk" }).transform('привіт світе!', "_")

  >pryvit_svite!
  • reverse()
  cyrillicToTranslit().reverse("ulitsa Soyuza Pechatnikov")

 >улица Союза Печатников
  cyrillicToTranslit({ preset: "uk" }).reverse("Rozghon Uliana i Harashchenko Khrystyna")

  >Розгон Уляна і Гаращенко Христина

Typescript

Typescript supports starting form v2.0.0. See definitions here

Credits

Why I've done this plugin?

https://alfilatov.com/posts/cyrillic-to-translit-js-library-for-converting-cyrillic-symbols-to-translit-and-vice-versa/

License

MIT © Aleksandr Filatov alfilatov.com

Versions

Version
3.1.0