Socket
Book a DemoInstallSign in
Socket

transliteration

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

transliteration

Unicode to ACSII transliteration / slugify module for node.js, browser, Web Worker, ReactNative and CLI.

2.3.5
latest
Source
npmnpm
Version published
Weekly downloads
470K
-1.65%
Maintainers
1
Weekly downloads
 
Created

What is transliteration?

The 'transliteration' npm package provides utilities for converting text between different scripts, particularly useful for converting non-Latin scripts to Latin scripts. It supports various transliteration schemes and can handle a wide range of languages.

What are transliteration's main functionalities?

Basic Transliteration

This feature allows you to convert text from non-Latin scripts to Latin scripts. In this example, Chinese characters are transliterated to their Latin equivalents.

const { transliterate } = require('transliteration');
const text = '你好,世界';
const result = transliterate(text);
console.log(result); // Output: 'Ni Hao , Shi Jie'

Slugify

This feature converts text into a URL-friendly slug. It is particularly useful for creating SEO-friendly URLs from non-Latin scripts.

const { slugify } = require('transliteration');
const text = '你好,世界';
const result = slugify(text);
console.log(result); // Output: 'ni-hao-shi-jie'

Custom Transliteration

This feature allows you to define custom mappings for transliteration. In this example, specific Cyrillic characters are mapped to their Latin equivalents.

const { transliterate } = require('transliteration');
const text = 'Привет, мир';
const customMap = { 'и': 'i', 'е': 'e', 'в': 'v' };
const result = transliterate(text, { customMap });
console.log(result); // Output: 'Privet, mir'

Other packages similar to transliteration

Keywords

transliterate

FAQs

Package last updated on 06 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.