{"_id":"@cjser/sindresorhus__slugify","_rev":"2-9d23df58782d93392cf05fffd7c1b69e","name":"@cjser/sindresorhus__slugify","dist-tags":{"latest":"3.0.1-cjser.2"},"versions":{"3.0.0-cjser.2":{"name":"@cjser/sindresorhus__slugify","version":"3.0.0-cjser.2","keywords":["string","slugify","slug","url","url-safe","urlify","transliterate","transliteration","deburr","unicode","ascii","text","decamelize","pretty","clean","filename","id"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"@cjser/sindresorhus__slugify@3.0.0-cjser.2","maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"xo":{"rules":{"@typescript-eslint/member-ordering":"off"}},"dist":{"shasum":"1266a0017ea6dc01d6ea681f9a90d53a405832ea","tarball":"https://registry.npmjs.org/@cjser/sindresorhus__slugify/-/sindresorhus__slugify-3.0.0-cjser.2.tgz","fileCount":7,"integrity":"sha512-4SFoFwtBtUjIDyRHdp8jwjSfCJOYab7G1SNvXxpOGGrb+Keegkw+WxGC8CpaVl3CICnkKhiVMXJgb27vp/zgeA==","signatures":[{"sig":"MEUCIQCLVjF0rChKreQSu5k8kZbkoc+BWMUDMfJE3GLojsJi/AIgH/k3Ppj460Bc5Oe490suBg5CrmjqDbF9l/tjfNBqIjE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24842},"main":"./dist-cjser/index.cjs","type":"module","cjser":{"original":{"name":"@sindresorhus/slugify","files":["index.js","index.d.ts","overridable-replacements.js"],"exports":{"types":"./index.d.ts","default":"./index.js"},"scripts":{"test":"xo && ava"},"version":"3.0.0","repository":"sindresorhus/slugify","dependencies":{"escape-string-regexp":"^5.0.0","@sindresorhus/transliterate":"^2.0.0"}},"cjserVersion":2,"sourceVersion":"3.0.0"},"types":"./index.d.ts","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js","require":"./dist-cjser/index.cjs"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"0168e4aac54a1a9ca6f921419fa5ed9edb53ef4a","scripts":{"test":"xo && ava"},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"repository":{"url":"https://code.moenext.com/3rdeye/cjser.git","type":"git"},"_npmVersion":"10.7.0","description":"Slugify a string","directories":{},"sideEffects":false,"_nodeVersion":"20.14.0","dependencies":{"@cjser/escape-string-regexp":"5.0.0-cjser.2","@cjser/sindresorhus__transliterate":"2.3.1-cjser.2"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.2","ava":"^6.4.1"},"_npmOperationalInternal":{"tmp":"tmp/sindresorhus__slugify_3.0.0-cjser.2_1778130996903_0.7672289138871966","host":"s3://npm-registry-packages-npm-production"}},"3.0.1-cjser.2":{"name":"@cjser/sindresorhus__slugify","version":"3.0.1-cjser.2","description":"Slugify a string","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":["string","slugify","slug","url","url-safe","urlify","transliterate","transliteration","deburr","unicode","ascii","text","decamelize","pretty","clean","filename","id"],"dependencies":{"@cjser/sindresorhus__transliterate":"2.3.1-cjser.2","@cjser/escape-string-regexp":"5.0.0-cjser.2"},"devDependencies":{"ava":"^6.4.1","xo":"^1.2.2"},"xo":{"rules":{"@typescript-eslint/member-ordering":"off"}},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"3.0.1","cjserVersion":2,"original":{"name":"@sindresorhus/slugify","version":"3.0.1","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/slugify","dependencies":{"@sindresorhus/transliterate":"^2.0.0","escape-string-regexp":"^5.0.0"},"files":["index.js","index.d.ts","overridable-replacements.js"],"scripts":{"test":"xo && ava"}}},"gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_id":"@cjser/sindresorhus__slugify@3.0.1-cjser.2","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-l5E8DLzx7dnwxZqWdefVemIAJ+8SwqzQ8DNLPQZmVhm6rV+pmynNL/aELObVYoGwrp/ameLV6Ph5XBCvHfSRpQ==","shasum":"0853b9ffbeb88ec1db0e0a732fa1951a4c861ae3","tarball":"https://registry.npmjs.org/@cjser/sindresorhus__slugify/-/sindresorhus__slugify-3.0.1-cjser.2.tgz","fileCount":7,"unpackedSize":26654,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDgQTt4pHcGDFc6OgBVVXkRG84U6lGBSf+t0PIEzD0rDQIgfDVwan/iJLhJJGo+0dbDASEmpoiM7AHOI4gSn+8h+nI="}]},"_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__slugify_3.0.1-cjser.2_1788288882816_0.035250503971455904"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T05:16:36.825Z","modified":"2026-09-01T18:54:43.228Z","3.0.0-cjser.2":"2026-05-07T05:16:37.034Z","3.0.1-cjser.2":"2026-09-01T18:54:42.948Z"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","keywords":["string","slugify","slug","url","url-safe","urlify","transliterate","transliteration","deburr","unicode","ascii","text","decamelize","pretty","clean","filename","id"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"description":"Slugify a string","maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"readme":"# slugify\n\n> Slugify a string\n\nUseful for URLs, filenames, and IDs.\n\nIt handles most major languages, including [German (umlauts)](https://en.wikipedia.org/wiki/Germanic_umlaut), Vietnamese, Arabic, Russian, [and more](https://github.com/sindresorhus/transliterate#supported-languages).\n\n## Install\n\n```sh\nnpm install @sindresorhus/slugify\n```\n\n## Usage\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('I ♥ Dogs');\n//=> 'i-love-dogs'\n\nslugify('  Déjà Vu!  ');\n//=> 'deja-vu'\n\nslugify('fooBar 123 $#%');\n//=> 'foo-bar-123'\n\nslugify('Conway’s Law');\n//=> 'conways-law'\n\nslugify('я люблю единорогов');\n//=> 'ya-lyublyu-edinorogov'\n```\n\n## API\n\n### slugify(string, options?)\n\n#### string\n\nType: `string`\n\nString to slugify.\n\n#### options\n\nType: `object`\n\n##### separator\n\nType: `string`\\\nDefault: `'-'`\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('BAR and baz');\n//=> 'bar-and-baz'\n\nslugify('BAR and baz', {separator: '_'});\n//=> 'bar_and_baz'\n\nslugify('BAR and baz', {separator: ''});\n//=> 'barandbaz'\n```\n\n##### lowercase\n\nType: `boolean`\\\nDefault: `true`\n\nMake the slug lowercase.\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('Déjà Vu!');\n//=> 'deja-vu'\n\nslugify('Déjà Vu!', {lowercase: false});\n//=> 'Deja-Vu'\n```\n\n##### decamelize\n\nType: `boolean`\\\nDefault: `true`\n\nConvert camelcase to separate words. Internally it does `fooBar` → `foo bar`.\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('fooBar');\n//=> 'foo-bar'\n\nslugify('fooBar', {decamelize: false});\n//=> 'foobar'\n```\n\n##### customReplacements\n\nType: `Array<string[]>`\\\nDefault: `[\n\t['&', ' and '],\n\t['🦄', ' unicorn '],\n\t['♥', ' love ']\n]`\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, like `&`.\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('Foo@unicorn', {\n\tcustomReplacements: [\n\t\t['@', 'at']\n\t]\n});\n//=> 'fooatunicorn'\n```\n\nAdd a leading and trailing space to the replacement to have it separated by dashes:\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('foo@unicorn', {\n\tcustomReplacements: [\n\t\t['@', ' at ']\n\t]\n});\n//=> 'foo-at-unicorn'\n```\n\nAnother example:\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('I love 🐶', {\n\tcustomReplacements: [\n\t\t['🐶', 'dogs']\n\t]\n});\n//=> 'i-love-dogs'\n```\n\n##### preserveLeadingUnderscore\n\nType: `boolean`\\\nDefault: `false`\n\nIf your string starts with an underscore, it will be preserved in the slugified string.\n\nSometimes leading underscores are intentional, for example, filenames representing hidden paths on a website.\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('_foo_bar');\n//=> 'foo-bar'\n\nslugify('_foo_bar', {preserveLeadingUnderscore: true});\n//=> '_foo-bar'\n```\n\n##### preserveTrailingDash\n\nType: `boolean`\\\nDefault: `false`\n\nIf your string ends with a dash, it will be preserved in the slugified string.\n\nFor example, using slugify on an input field would allow for validation while not preventing the user from writing a slug.\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('foo-bar-');\n//=> 'foo-bar'\n\nslugify('foo-bar-', {preserveTrailingDash: true});\n//=> 'foo-bar-'\n```\n\n##### preserveCharacters\n\nType: `string[]`\\\nDefault: `[]`\n\nPreserve certain characters.\n\nIt cannot contain the `separator`.\n\nThe apostrophe in a word-final `'s` or `'t` is still dropped, even if you preserve `'`.\n\nFor example, if you want to slugify URLs, but preserve the HTML fragment `#` character.\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('foo_bar#baz', {preserveCharacters: ['#']});\n//=> 'foo-bar#baz'\n```\n\n##### locale\n\nType: `string`\\\nDefault: `undefined`\n\nThe locale to use for language-specific transliteration.\n\nSee the [`@sindresorhus/transliterate` package](https://github.com/sindresorhus/transliterate#locale) for more info.\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('Räksmörgås');\n//=> 'raeksmoergas'\n\nslugify('Räksmörgås', {locale: 'sv'});\n//=> 'raksmorgas'\n```\n\n##### transliterate\n\nType: `boolean`\\\nDefault: `true`\n\nWhether to transliterate Unicode characters to ASCII.\n\nWhen `false`, non-ASCII characters will be preserved instead of being transliterated. This can improve performance when you don't need transliteration.\n\n```js\nimport slugify from '@sindresorhus/slugify';\n\nslugify('Déjà Vu');\n//=> 'deja-vu'\n\nslugify('Déjà Vu', {transliterate: false});\n//=> 'déjà-vu'\n```\n\n### slugifyWithCounter()\n\nReturns a new instance of `slugify(string, options?)` with a counter to handle multiple occurrences of the same string.\n\n#### Example\n\n```js\nimport {slugifyWithCounter} from '@sindresorhus/slugify';\n\nconst slugify = slugifyWithCounter();\n\nslugify('foo bar');\n//=> 'foo-bar'\n\nslugify('foo bar');\n//=> 'foo-bar-2'\n\nslugify.reset();\n\nslugify('foo bar');\n//=> 'foo-bar'\n```\n\n#### Use-case example of counter\n\nIf, for example, you have a document with multiple sections where each subsection has an example.\n\n```md\n## Section 1\n\n### Example\n\n## Section 2\n\n### Example\n```\n\nYou can then use `slugifyWithCounter()` to generate unique HTML `id`'s to ensure anchors will link to the right headline.\n\n### slugify.reset()\n\nReset the counter\n\n#### Example\n\n```js\nimport {slugifyWithCounter} from '@sindresorhus/slugify';\n\nconst slugify = slugifyWithCounter();\n\nslugify('foo bar');\n//=> 'foo-bar'\n\nslugify('foo bar');\n//=> 'foo-bar-2'\n\nslugify.reset();\n\nslugify('foo bar');\n//=> 'foo-bar'\n```\n\n## Related\n\n- [slugify-cli](https://github.com/sindresorhus/slugify-cli) - CLI for this module\n- [transliterate](https://github.com/sindresorhus/transliterate) - Convert Unicode characters to Latin characters using transliteration\n- [filenamify](https://github.com/sindresorhus/filenamify) - Convert a string to a valid safe filename\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/slugify\n","readmeFilename":"readme.md"}