# @stream-io/transliterate

> Convert Unicode characters to Latin characters using transliteration

Latest version **1.5.5** (published 2021-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @stream-io/transliterate
pnpm add @stream-io/transliterate
yarn add @stream-io/transliterate
bun add @stream-io/transliterate
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.5.5 |
| Published | 2021-12-20 |
| First published | 2021-12-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 2 |
| Unpacked size | 365.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sindre Sorhus |
| Maintainers | yetieaterxb1, ambaldwin, zacheryconverse, madsroskar, caleb.murphy, zita.szupera, petyosi, tbarbugli, tschellenbach, jaapbakker88, mahboubii, vishtree, lukesmetham |
| Keywords | transliterate, transliteration, string, deburr, unicode, ascii, text, latin, latinize, convert, replace |

## Links

- npm: https://www.npmjs.com/package/@stream-io/transliterate
- Repository: https://github.com/GetStream/transliterate
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/@stream-io/transliterate

## Dependencies (2)

- [lodash.deburr](https://npm.io/package/lodash.deburr.md) ^4.1.0
- [@stream-io/escape-string-regexp](https://npm.io/package/@stream-io/escape-string-regexp.md) ^5.0.1

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.5.5 (latest) — 2021-12-20
- 1.5.4 — 2021-12-20
- 1.5.3 — 2021-12-20
- 1.5.2 — 2021-12-01
- 1.5.1 — 2021-12-01
- 1.5.0 — 2021-12-01

## README

# transliterate

> Convert Unicode characters to Latin characters using [transliteration](https://en.wikipedia.org/wiki/Transliteration)

Can be useful for [slugification](https://github.com/sindresorhus/slugify) purposes and other times you cannot use Unicode.

## Install

```
$ npm install @sindresorhus/transliterate
```

## Usage

```js
import transliterate from '@sindresorhus/transliterate';

transliterate('Fußgängerübergänge');
//=> 'Fussgaengeruebergaenge'

transliterate('Я люблю единорогов');
//=> 'Ya lyublyu edinorogov'

transliterate('أنا أحب حيدات');
//=> 'ana ahb hydat'

transliterate('tôi yêu những chú kỳ lân');
//=> 'toi yeu nhung chu ky lan'
```

## API

### transliterate(string, options?)

#### string

Type: `string`

String to transliterate.

#### options

Type: `object`

##### customReplacements

Type: `Array<string[]>`\
Default: `[]`

Add your own custom replacements.

The replacements are run on the original string before any other transformations.

This only overrides a default replacement if you set an item with the same key.

```js
import transliterate from '@sindresorhus/transliterate';

transliterate('Я люблю единорогов', {
	customReplacements: [
		['единорогов', '🦄']
	]
})
//=> 'Ya lyublyu 🦄'
```

## Supported languages

Most major languages are supported.

This includes special handling for:

- Arabic
- Armenian
- Czech
- Danish
- Dhivehi
- Georgian
- German (umlauts)
- Greek
- Hungarian
- Latin
- Latvian
- Lithuanian
- Macedonian
- Pashto
- Persian
- Polish
- Romanian
- Russian
- Serbian
- Slovak
- Swedish
- Turkish
- Ukrainian
- Urdu
- Vietnamese

However, Chinese is [currently not supported](https://github.com/sindresorhus/transliterate/issues/1).

## Related

- [slugify](https://github.com/sindresorhus/slugify) - Slugify a string

---
_Source: https://npm.io/package/@stream-io/transliterate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
