{"_id":"@sindresorhus/transliterate@3.0.0","bugs":{"url":"https://github.com/sindresorhus/transliterate/issues"},"dist":{"shasum":"c07dd79dd6d57b9e36e885472e850dd9b319b174","tarball":"http://registry-npm.ywwl.com/@sindresorhus/transliterate/download/@sindresorhus/transliterate-3.0.0.tgz","fileCount":7,"integrity":"sha512-mqOUtMxpY419WtwwYw1EX865Oh+QWpa37yhGLXNmVc6d91wsBYLG51TgSePqrdnCSnTJn2AygX+35StK86tNOA==","signatures":[{"sig":"MEYCIQDrNg4WzKTdLessI3/oMNGdV1+jG0d3V1WUzcUpPyaXZwIhALC7S+YDP1D5xMnA/vETCMi7uYQeG+zEeO5AQ8IbmZAS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCG7K2iqKpqTzhrbSOc1WW6Vc+sc8pm2QezP8ONCGq3ZAIhAKMbkk23YgQa9azAYpJuaVyROKBz4FPETdCRbW3GY9hB"}],"unpackedSize":95008,"size":27784,"noattachment":false,"key":"/@sindresorhus/transliterate/-/@sindresorhus/transliterate-3.0.0.tgz"},"name":"@sindresorhus/transliterate","type":"module","types":"./index.d.ts","author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"engines":{"node":">=22"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"367c50a39ab38e32ab31b1b67811d2f4f8fbcee3","license":"MIT","scripts":{"test":"xo && node --test"},"version":"3.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"homepage":"https://github.com/sindresorhus/transliterate#readme","keywords":["transliterate","transliteration","string","deburr","unicode","ascii","text","latin","latinize","convert","replace"],"repository":{"url":"git+https://github.com/sindresorhus/transliterate.git","type":"git"},"_npmVersion":"12.2.0","description":"Convert Unicode characters to Latin characters using transliteration","directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"sideEffects":false,"_nodeVersion":"26.12.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^5.0.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/transliterate_3.0.0_1793653541053_0.3762159382271032"},"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\nThrows a `RangeError` if any string being normalized contains more than 100 consecutive Unicode combining marks. This includes the input, custom replacement keys, and intermediate results. The total string length is not limited.\n\n#### string\n\nType: `string`\n\nString to transliterate.\n\n#### options\n\nType: `object`\n\n##### customReplacements\n\nType: `Array<[string, string]> | Map<string, string>`\\\nDefault: `[]`\n\nAdd your own custom replacements.\n\nThe replacements are run on the original string before any other transformations. Both the string and the keys are normalized to NFC first, so a key matches canonically equivalent text.\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- `bg` - Bulgarian\n- `da` - Danish\n- `de` - German\n- `hu` - Hungarian\n- `nb` - Norwegian Bokmål\n- `sr` - Serbian\n- `sv` - Swedish\n- `tr` - Turkish\n\nThe `no` and `nn` language codes are aliases for `nb`.\n\n## Supported languages\n\nMost major languages are supported.\n\nThis includes special handling for:\n\n- Arabic\n- Armenian\n- Belarusian\n- Bulgarian\n- Croatian\n- Czech\n- Danish\n- Dhivehi\n- Georgian\n- German (umlauts)\n- Greek\n- Hungarian\n- Kazakh\n- Kurdish\n- Latin\n- Latvian\n- Lithuanian\n- Macedonian\n- Pashto\n- Persian\n- Polish\n- Romanian\n- Russian\n- Serbian\n- Sindhi\n- Slovak\n- Slovenian\n- Swedish\n- Tatar\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","publish_time":1793653541194,"_cnpm_publish_time":1793653541194,"dist-tags":{"latest":"3.0.0"}}