{"name":"slug","description":"slugifies even utf-8 chars!","version":"12.0.1","type":"module","homepage":"https://github.com/Trott/slug","author":{"name":"dodo","url":"https://github.com/dodo"},"repository":{"type":"git","url":"git://github.com/Trott/slug.git"},"bugs":{"url":"https://github.com/Trott/slug/issues"},"main":"slug.js","bin":{"slug":"cli.js"},"keywords":["slugify","slug","string","utf8","utf-8","unicode","url"],"scripts":{"test":"standard && c8 --100 node --test test/*.js && web-test-runner test/**/*.js --node-resolve","benchmark":"node benchmark/benchmark.js"},"devDependencies":{"@esm-bundle/chai":"^4.3.4-fix.0","@semantic-release/changelog":"^6.0.1","@semantic-release/git":"^10.0.1","@web/test-runner":"^1.0.0","c8":"^12.0.0","semantic-release":"^25.0.1","standard":"^17.1.0"},"license":"MIT","release":{"branches":["main",{"name":"beta","prerelease":true}],"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}"}]]},"gitHead":"b29b285a644581964765d4d81b5cf29a58459ecc","_id":"slug@12.0.1","_nodeVersion":"24.18.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-p8lJZLw/5GDmxXO3FKjiOYjiBMFGDc+/8DgutoXKqjn8KX7buzbkX1unEavO7T+GHGLTOyeb7VjWTRWpb8wmuQ==","shasum":"970903c03378c54f2abb46011feb781efbad7b9b","tarball":"http://registry-npm.ywwl.com/slug/download/slug-12.0.1.tgz","fileCount":7,"unpackedSize":33810,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/slug@12.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDMX/B2+w5+8+PLWVrYnZ/ALwf00QWw+WpcKLuJV/kuRAiEA2AXcAxhg3m+gVwTDS55GpP5bzW2bWpp7G2xzPWKwxi0="}],"size":12470,"noattachment":false,"key":"/slug/-/slug-12.0.1.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b71bc3fb-1675-4ea3-8501-a58df704691b"}},"directories":{},"maintainers":[{"name":"trott","email":"rtrott@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/slug_12.0.1_1784662694100_0.9077887910868991"},"_hasShrinkwrap":false,"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":1784662694242,"_cnpm_publish_time":1784662694242,"dist-tags":{"beta":"11.0.0-beta.1","latest":"12.0.1"}}