{"name":"slug","version":"11.0.1","keywords":["slugify","slug","string","utf8","utf-8","unicode","url"],"author":{"url":"https://github.com/dodo","name":"dodo"},"license":"MIT","_id":"slug@11.0.1","maintainers":[{"name":"trott","email":"rtrott@gmail.com"}],"homepage":"https://github.com/Trott/slug","bugs":{"url":"https://github.com/Trott/slug/issues"},"bin":{"slug":"cli.js"},"dist":{"shasum":"917eef01e211c12f7a28727911c023f9ce01349b","tarball":"http://registry-npm.ywwl.com/slug/download/slug-11.0.1.tgz","fileCount":7,"integrity":"sha512-VrM060OM/E7rdLQSnp6JHrzFfJFmqQBp0+TMhZStnEB8PfNliaZ9UWYjTHGHLUFVJorZ8TjVd/aKvIxHWU2O7g==","signatures":[{"sig":"MEUCIQDHiPBptpxawP4QnSgkjPJ/JwF2VWEwN51zbmEq+gw4YgIgZk+h4rlEqzi2dJg1OcJCvX+KbL1IgCk2WfNzI6jd9ik=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33228,"size":12305,"noattachment":false,"key":"/slug/-/slug-11.0.1.tgz"},"main":"slug.js","type":"module","gitHead":"97ab8b84d21ff8e2abc3fb83049a2101d7303fd5","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}]],"branches":["main",{"name":"beta","prerelease":true}]},"scripts":{"test":"standard && c8 --100 mocha test/**/*.js && web-test-runner test/**/*.js --node-resolve","benchmark":"node benchmark/benchmark.js"},"_npmUser":{"name":"trott","email":"rtrott@gmail.com"},"repository":{"url":"git://github.com/Trott/slug.git","type":"git"},"_npmVersion":"10.9.3","description":"slugifies even utf-8 chars!","directories":{},"_nodeVersion":"22.20.0","_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.2","mocha":"^11.0.1","standard":"^17.1.0","@esm-bundle/chai":"^4.3.4-fix.0","@web/test-runner":"^0.20.0","semantic-release":"^24.0.0","@semantic-release/git":"^10.0.1","@semantic-release/changelog":"^6.0.1"},"_npmOperationalInternal":{"tmp":"tmp/slug_11.0.1_1760368207944_0.7790514469696315","host":"s3://npm-registry-packages-npm-production"},"readme":"# [slug](https://github.com/Trott/slug)\n\nSlugifies strings, even when they contain Unicode.\n\nMake strings URL-safe.\n\n- Respects [RFC 3986](https://tools.ietf.org/html/rfc3986)\n- No dependencies\n- Works in the browser or in Node.js\n\n```\nnpm install slug\n```\n\nIf you are using TypeScript you can install the accompanying types\n\n```\nnpm install --save-dev @types/slug\n```\n\n## Example\n\n```javascript\nimport slug from 'slug'\nvar print = console.log.bind(console, '>')\n\nprint(slug('i love unicode'))\n// > i-love-unicode\n\nprint(slug('i love unicode', '_')) // If you prefer something else than `-` as separator\n// > i_love_unicode\n\nslug.charmap['♥'] = 'freaking love' // change default charmap or use option {charmap:{…}} as 2. argument\nprint(slug('I ♥ UNICODE'))\n// > i-freaking-love-unicode\n\n// To reset modifications to slug.charmap, use slug.reset():\nslug.reset()\nprint(slug('I ♥ UNICODE'))\n// > i-unicode\n\nprint(slug('Telephone-Number')) // lower case by default\n// > telephone-number\n\nprint(slug('Telephone-Number', {lower: false})) // If you want to preserve case\n// > Telephone-Number\n\n// We try to provide sensible defaults.\n// So Cyrillic text will be transliterated as if it were Russian:\nprint(slug('маленький подъезд'))\n// > malenkij-poduezd\n\n// But maybe you know it's Bulgarian:\nprint(slug('маленький подъезд', { locale: 'bg' }))\n// > malenykiy-podaezd\n\n// To set the default locale:\nslug.setLocale('bg')\nprint(slug('маленький подъезд'))\n// > malenykiy-podaezd\n\nprint(slug('unicode is ☢'))\n// > unicode-is\n\nslug.extend({'☢': 'radioactive'})\nprint(slug('unicode ♥ is ☢'))\n// > unicode-is-radioactive\n\n// slug.extend() modifies the default charmap for the entire process.\n// If you need to reset charmap, multicharmap, and the default locale, use slug.reset():\n\nslug.reset()\nprint(slug('unicode ♥ is ☢'))\n// > unicode-is\n\n// Custom removal of characters from resulting slug. Let's say that we want to\n// remove all numbers for some reason.\nprint(slug('one 1 two 2 three 3'))\n// > one-1-two-2-three-3\nprint(slug('one 1 two 2 three 3', { remove: /[0-9]/g }))\n// > one-two-three\n```\n\n## options\n\n```javascript\n// options is either object or replacement (sets options.replacement)\nslug('string', [{options} || 'replacement']);\n```\n\n```javascript\nslug.defaults.mode ='pretty';\nslug.defaults.modes['rfc3986'] = {\n    replacement: '-',      // replace spaces with replacement\n    remove: null,          // (optional) regex to remove characters\n    lower: true,           // result in lower case\n    charmap: slug.charmap, // replace special characters\n    multicharmap: slug.multicharmap, // replace multiple code unit characters\n    trim: true,             // trim leading and trailing replacement chars\n    fallback: true          // use base64 to generate slug for empty results\n};\nslug.defaults.modes['pretty'] = {\n    replacement: '-',\n    remove: null,\n    lower: true,\n    charmap: slug.charmap,\n    multicharmap: slug.multicharmap,\n    trim: true,\n    fallback: true\n};\n```\n\n## Differences between `slug` and `slugify` packages\n\nHere are some key differences between this package and [`slugify`](https://github.com/simov/slugify).\n\n- **Stability:** `slug` is ESM-only.  \n  `slugify` supports CommonJS and ESM.\n- **Defaults:** `slug` has the `lower` option enabled by default, lowercasing all slugs\n  (`'On SALE'` becomes `'on-sale'`).  \n  `slugify` has the `lower` option disabled by default (`'On SALE'` becomes `'On-SALE'`).\n- **Symbols:** `slug` removes unrecognized symbols (`'$100'` becomes `'100'`, `'<5'` becomes `'5'`, etc.).  \n  `slugify` maps them to words (`'$100'` becomes `'dollar100'`, `'<5'` becomes `'less5'`, etc.).\n- **Empty Output:** `slug` will return a short, predictable hash (`'   '` becomes `'icag'` and `'🎉'` becomes `'8joiq'`).  \n  `slugify` will return an empty string (`'   '` and `'🎉'` become `''`).\n\n## Playground\n\nA web playground is available at https://trott.github.io/slug/.\n\nThere is also a CLI tool available via `npx slug`. It doesn't allow you to\nspecify options, so it's utility is minimal.\n","publish_time":1760368208134,"_cnpm_publish_time":1760368208134,"dist-tags":{"beta":"11.0.0-beta.1","latest":"12.0.1"}}