{"_id":"@cjser/sindresorhus__transliterate","name":"@cjser/sindresorhus__transliterate","dist-tags":{"latest":"2.3.1-cjser.2"},"versions":{"2.3.1-cjser.2":{"name":"@cjser/sindresorhus__transliterate","version":"2.3.1-cjser.2","description":"Convert Unicode characters to Latin characters using transliteration","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","require":"./dist-cjser/index.cjs","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava"},"keywords":["transliterate","transliteration","string","deburr","unicode","ascii","text","latin","latinize","convert","replace"],"devDependencies":{"ava":"^6.4.1","xo":"^1.2.2"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"2.3.1","cjserVersion":2,"original":{"name":"@sindresorhus/transliterate","version":"2.3.1","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/transliterate","files":["index.js","index.d.ts","replacements.js","locale-replacements.js"],"scripts":{"test":"xo && ava"}}},"_id":"@cjser/sindresorhus__transliterate@2.3.1-cjser.2","gitHead":"0168e4aac54a1a9ca6f921419fa5ed9edb53ef4a","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-tG02SuXxHilPjxKNSKG+nHzynaqQqExJUPJkmIq9WBbBXW2H6oGlYlElgZa/oWDi8Uw19NMGKlJ3PUbFeNK4OQ==","shasum":"4db4661de33c1302790e15c85d168445a732bde7","tarball":"https://registry.npmjs.org/@cjser/sindresorhus__transliterate/-/sindresorhus__transliterate-2.3.1-cjser.2.tgz","fileCount":8,"unpackedSize":91645,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICswq3noJKe2Lwxbbx1r3r2Mq+6QZYCqb3a6NcmfrMf8AiBww6tnJ1hHoVbC4Hb7R7U3D9iOXbZtMSi7LCK73aW0eg=="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sindresorhus__transliterate_2.3.1-cjser.2_1778131005738_0.5610199897758421"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T05:16:45.636Z","2.3.1-cjser.2":"2026-05-07T05:16:45.886Z","modified":"2026-05-07T05:16:46.366Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Convert Unicode characters to Latin characters using transliteration","keywords":["transliterate","transliteration","string","deburr","unicode","ascii","text","latin","latinize","convert","replace"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","readme":"# transliterate\n\n> Convert Unicode characters to Latin characters using [transliteration](https://en.wikipedia.org/wiki/Transliteration)\n\nCan be useful for [slugification](https://github.com/sindresorhus/slugify) purposes and other times you cannot use Unicode.\n\n## Install\n\n```sh\nnpm install @sindresorhus/transliterate\n```\n\n## Usage\n\n```js\nimport transliterate from '@sindresorhus/transliterate';\n\ntransliterate('Fußgängerübergänge');\n//=> 'Fussgaengeruebergaenge'\n\ntransliterate('Я люблю единорогов');\n//=> 'Ya lyublyu edinorogov'\n\ntransliterate('أنا أحب حيدات');\n//=> 'ana ahb hydat'\n\ntransliterate('tôi yêu những chú kỳ lân');\n//=> 'toi yeu nhung chu ky lan'\n\ntransliterate('En–dashes and em—dashes are normalized');\n//=> 'En-dashes and em-dashes are normalized'\n```\n\n## API\n\n### transliterate(string, options?)\n\n#### string\n\nType: `string`\n\nString to transliterate.\n\n#### options\n\nType: `object`\n\n##### customReplacements\n\nType: `Array<string[]> | Map<string, string>`\\\nDefault: `[]`\n\nAdd your own custom replacements.\n\nThe replacements are run on the original string before any other transformations.\n\nThis only overrides a default replacement if you set an item with the same key.\n\n```js\nimport transliterate from '@sindresorhus/transliterate';\n\ntransliterate('Я люблю единорогов', {\n\tcustomReplacements: [\n\t\t['единорогов', '🦄']\n\t]\n})\n//=> 'Ya lyublyu 🦄'\n```\n\nYou can also pass a `Map`:\n\n```js\ntransliterate('foo & bar', {\n\tcustomReplacements: new Map([\n\t\t['&', 'and']\n\t])\n})\n//=> 'foo and bar'\n```\n\n##### locale\n\nType: `string`\n\n[BCP-47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag) language tag for language-specific transliteration.\n\nWhen specified, uses language-specific replacement rules for characters that have different transliterations in different languages.\n\n```js\nimport transliterate from '@sindresorhus/transliterate';\n\n// Swedish: ä→a, ö→o, å→a\ntransliterate('Räksmörgås', {locale: 'sv'});\n//=> 'Raksmorgas'\n\n// German: ä→ae, ö→oe\ntransliterate('Räksmörgås', {locale: 'de'});\n//=> 'Raeksmoergas'\n```\n\n### Supported locales\n\nThe following locales have specific replacement rules when using the `locale` option:\n\n- `da` - Danish\n- `de` - German\n- `hu` - Hungarian\n- `nb` - Norwegian Bokmål\n- `sr` - Serbian\n- `sv` - Swedish\n- `tr` - Turkish\n\n## Supported languages\n\nMost major languages are supported.\n\nThis includes special handling for:\n\n- Arabic\n- Armenian\n- Czech\n- Danish\n- Dhivehi\n- Georgian\n- German (umlauts)\n- Greek\n- Hungarian\n- Latin\n- Latvian\n- Lithuanian\n- Macedonian\n- Pashto\n- Persian\n- Polish\n- Romanian\n- Russian\n- Serbian\n- Slovak\n- Swedish\n- Turkish\n- Ukrainian\n- Urdu\n- Vietnamese\n\nHowever, Chinese is [currently not supported](https://github.com/sindresorhus/transliterate/issues/1).\n\n## Related\n\n- [slugify](https://github.com/sindresorhus/slugify) - Slugify a string\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/transliterate\n","readmeFilename":"readme.md","_rev":"1-dedf3431a4017e6028e8976a595fa00b"}