{"_id":"@20minutes/content-slug","_rev":"4-82bc0d74c667910dafe50fb822db6b4f","name":"@20minutes/content-slug","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@20minutes/content-slug","version":"1.0.0","license":"MIT","_id":"@20minutes/content-slug@1.0.0","maintainers":[{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},{"name":"j0k3r","email":"jeremy.benoist@gmail.com"}],"dist":{"shasum":"9d29b31979cfa92927cd400fd5ee7cf1823c4bcd","tarball":"https://registry.npmjs.org/@20minutes/content-slug/-/content-slug-1.0.0.tgz","fileCount":6,"integrity":"sha512-lqSxnaiSUaNuEsBt41sDpvrmNWM5pQvWbXE1uvENxeDd1VKHcOJLMF9uus7LOzXMkW9FNZ+T1Aa+VFkQa79MKw==","signatures":[{"sig":"MEUCIHwdsK6D0JX5l+5NKbCSw2V8KOsI9sHbkFBNwFOtfN2rAiEAs7grNF7DimX8JKAZvo905ZBgdvfWrxyzTZEyN9tYvLg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPAPXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqMlA//cHl7TJRG9rX6Tv++Xw9uTE+gUBQRD474RhPivcWzEBTj/CBB\r\nBM6f8t3tfWLP2P1WAba3T/o3I3hbWKGocgqeIo9PCOvx/yve0wjv3xzaO07Y\r\nvbYJ1KpcxwqeII9bc0jCvnH/+9Lb5pWll2qCR7TEcyhpf13TW/tZjzqrU28g\r\neKgOtun/7wVEv/6HXdb5fHsH80ILR2A7JzZnz23nuqk9GhsyMlInWmFljRU/\r\njOjYtWg+92iWjN1uBCZOQznO9PUcZYsv6CyvMYzF8nX7KZbRR+mUCEE8VsxD\r\nk3MZ5BaboxJjQ0/Cvnc+2YDLMUF9XdxWLikLAV9V3bX+PLG5pJ9JZW/pkgbQ\r\nqqurAtB7gzKl5/UxsBuHphml385d/mD5aLDelp0agkcdkJrepd8wYeOsMXyY\r\nQGIC0KH859gmt9YO6Abrcppc8YIFRZOLuh7QO9kEvOLrv6Lusp0AvVKZ9UJp\r\nFy8leR61APYSrATBt2HmmQCnkg57sEcrYQEI8mh+8F6IrBVY9iy3q2YGQY3p\r\n2vb66hMoLrPwealhJNr8jtlm53/rKY6FxO7i070CI3G2c/rFmix02Xz8mfRL\r\na6015F8Zt10mF6vUeyMchE13we14DYvnIEI9ZYqV9VZUEvuk5Uw5oxWgz+VB\r\nmZNCg90jv0F3PswuzN+eN61ffwz37cS3/Yo=\r\n=RlZu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","types":"lib/index.d.ts","scripts":{"lint":"eslint src/* tests/* *.ts","test":"jest --silent false","build":"tsc","prepare":"yarn build"},"_npmUser":{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},"repository":{"url":"https://github.com/20minutes/content-slug.git","type":"git"},"description":"Content slugification for 20 Minutes","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2022 20 Minutes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","dependencies":{"url-slug":"^3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","eslint":"^8.24.0","ts-jest":"^29.0.3","ts-node":"^10.9.1","prettier":"^2.4.1","typescript":"^4.8.4","@babel/core":"^7.16.0","@types/jest":"^29.1.1","eslint-plugin-babel":"^5.0","eslint-plugin-react":"^7.27.0","@babel/eslint-parser":"^7.16.3","eslint-config-airbnb":"^19.0.4","eslint-plugin-import":"^2.25.3","eslint-config-prettier":"^8.5.0","eslint-plugin-jsx-a11y":"^6.5.1","eslint-plugin-prettier":"^4.0.0","@20minutes/eslint-config":"^1.2.4","@typescript-eslint/parser":"^5.39.0","eslint-plugin-react-hooks":"^4.3.0","@typescript-eslint/eslint-plugin":"^5.39.0","eslint-import-resolver-typescript":"^3.5.1"},"_npmOperationalInternal":{"tmp":"tmp/content-slug_1.0.0_1664877527504_0.5912678674579188","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@20minutes/content-slug","version":"1.0.1","license":"MIT","_id":"@20minutes/content-slug@1.0.1","maintainers":[{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},{"name":"j0k3r","email":"jeremy.benoist@gmail.com"}],"dist":{"shasum":"052e09976732bfb75d5a9d7a3e0c4cee37902ac4","tarball":"https://registry.npmjs.org/@20minutes/content-slug/-/content-slug-1.0.1.tgz","fileCount":7,"integrity":"sha512-AXs6OjBelwCyJVTWWQoE0WZM3e0Zgwp3U/hA3+GtDOW5KTWEmBEob2p7FLC68UFjBdQV0uWUEuBJUejzlmA70w==","signatures":[{"sig":"MEYCIQCpljwxuxRsU0Lj0ZaPtXZt//GFl1jz8QHc9ugQa4pEXQIhAIw/xe4vIX3m5ywAbCPh4q6YNnGmVGohHEqVPMepxu/c","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPAhAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEjA/+Mv9f49ZOhTeJD/D6hSGBExVIUpUEMI/T7d8Qs9b3viKX8SZn\r\nyvmPfoEbQjfbHNNcbNlmxhw6/YaGpYqGTiFmJtPLR9tt+gSaQN3Af16W94m3\r\nbEjgdNyaPfZF2HXE2eIfvm6vZFWBT/iBxABXR32B+v4PSXriu1Hl+Ap3sB4S\r\n4n+Fy8WZl2Sy+HT91MprrCzifylJOpUWIC8lnu8FQ1fY31i5MLgueomu+IU3\r\n5rHcqr0bKmiMxKfcgI+wqTCLb4dBGFGFf857PiCYpCX+TI3HsAgERlWOnc3z\r\nTQa6kCgwvOZfWyXe+02JaFrofw22SVfXMOY2mI1ZzAmznWRUZkcio7Fzq/p3\r\nkxO4WErnxlE5eeozmthmMAO1Me9FZ7i80hm4Jl4OohHWK/wKudIJks6rpg5Z\r\nuDlzzEHisXLw95BOfkxv97diecqY2v2uBIRZ8slqpE9vFdV/K7cX+oH7qKpp\r\niWnIP7X4emb27jFyFlWni04VLswr7GRl9pFT7temYbp5tbApJvHxzh/PsYzN\r\nBctDv385mhlAWBIyG3xqMymvdHMjZ7WWj4jbv3+hxbJX3LKCCVb8LFsoStZo\r\nLm9ntGAGKT2/gq4cY3fGMrU0p2+9t78mgcWKgfA/Xy1hznzCU3P3HE0K4A6a\r\nrLNSrWkccmymODVKkssTEyVg/eRKdBo19Sw=\r\n=wwNe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","types":"lib/index.d.ts","scripts":{"lint":"eslint src/* tests/* *.ts","test":"jest --silent false","build":"tsc","prepare":"yarn build"},"_npmUser":{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},"repository":{"url":"https://github.com/20minutes/content-slug.git","type":"git"},"description":"Content slugification for 20 Minutes","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2022 20 Minutes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","dependencies":{"url-slug":"^3.0.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.1.2","eslint":"^8.24.0","ts-jest":"^29.0.3","ts-node":"^10.9.1","prettier":"^2.4.1","typescript":"^4.8.4","@babel/core":"^7.16.0","@types/jest":"^29.1.1","eslint-plugin-babel":"^5.0","eslint-plugin-react":"^7.27.0","@babel/eslint-parser":"^7.16.3","eslint-config-airbnb":"^19.0.4","eslint-plugin-import":"^2.25.3","eslint-config-prettier":"^8.5.0","eslint-plugin-jsx-a11y":"^6.5.1","eslint-plugin-prettier":"^4.0.0","@20minutes/eslint-config":"^1.2.4","@typescript-eslint/parser":"^5.39.0","eslint-plugin-react-hooks":"^4.3.0","@typescript-eslint/eslint-plugin":"^5.39.0","eslint-import-resolver-typescript":"^3.5.1"},"_npmOperationalInternal":{"tmp":"tmp/content-slug_1.0.1_1664878655965_0.6439751559684244","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@20minutes/content-slug","version":"2.0.0","license":"MIT","_id":"@20minutes/content-slug@2.0.0","maintainers":[{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},{"name":"j0k3r","email":"jeremy.benoist@gmail.com"}],"dist":{"shasum":"b7e083ee25c29a275a5a193a3762c69952c072b4","tarball":"https://registry.npmjs.org/@20minutes/content-slug/-/content-slug-2.0.0.tgz","fileCount":11,"integrity":"sha512-jH0nMIwa8nkCciC5H0a9drczIEfeZz56p3s4KylUfNzND7iMpH7LIQUfkbetkPLItKgzQ8Q5HIcU25vkvbaiJg==","signatures":[{"sig":"MEYCIQD/ttyDANZA4t4OjwfcY0Dr/+Fpv+2pFMOuyUZuU9OjjAIhAOcGcm+LBe1hlsbHbIxA1DN0ootnuu91qAo0gKLb4dUF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15990},"main":"lib/cjs/index.js","type":"module","types":"lib/esm/index.d.ts","module":"lib/esm/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./lib/esm/index.d.ts","import":"./lib/esm/index.js","require":"./lib/cjs/index.js"}},"scripts":{"lint":"eslint src/* tests/* *.ts","test":"yarn build && jest --silent false","build":"yarn clean && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && node scripts/write-cjs-package.cjs","clean":"rimraf lib","typecheck":"tsc -p tsconfig.json"},"_npmUser":{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},"repository":{"url":"https://github.com/20minutes/content-slug.git","type":"git"},"description":"Content slugification for 20 Minutes","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2022 20 Minutes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","dependencies":{"url-slug":"^4.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","eslint":"^9.0.0","rimraf":"^6.0.1","ts-jest":"^29.4.6","ts-node":"^10.9.2","prettier":"^3.8.1","typescript":"^5.9.3","@types/jest":"^30.0.0","@types/node":"^25.2.0","eslint-plugin-react":"^7.37.5","eslint-plugin-import":"^2.32.0","eslint-config-prettier":"^10.1.8","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-prettier":"^5.5.5","@20minutes/eslint-config":"^2.0.0","@typescript-eslint/parser":"^8.54.0","eslint-plugin-react-hooks":"^7.0.1","@typescript-eslint/eslint-plugin":"^8.54.0","eslint-import-resolver-typescript":"^4.4.4"},"_npmOperationalInternal":{"tmp":"tmp/content-slug_2.0.0_1770300665865_0.9133000340960808","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@20minutes/content-slug","version":"2.0.1","description":"Content slugification for 20 Minutes","license":"MIT","repository":{"type":"git","url":"https://github.com/20minutes/content-slug.git"},"type":"module","main":"lib/cjs/index.js","module":"lib/esm/index.js","types":"lib/esm/index.d.ts","exports":{".":{"types":"./lib/esm/index.d.ts","import":"./lib/esm/index.js","require":"./lib/cjs/index.js"}},"scripts":{"clean":"rimraf lib","build":"yarn clean && tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && node scripts/write-cjs-package.cjs","typecheck":"tsc -p tsconfig.json","test":"yarn build && vitest run --coverage","lint":"biome check --max-diagnostics=none","lint:fix":"biome check --write --unsafe --max-diagnostics=none"},"devDependencies":{"@20minutes/eslint-config":"^3.0.0","@types/node":"^25.2.0","@vitest/coverage-v8":"^4.1.2","rimraf":"^6.0.1","ts-node":"^10.9.2","typescript":"^6.0.2","vitest":"^4.1.2"},"engines":{"node":">=22.0.0"},"dependencies":{"url-slug":"^5.0.0"},"licenseText":"MIT License\n\nCopyright (c) 2022 20 Minutes\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@20minutes/content-slug@2.0.1","dist":{"shasum":"f0103b4f30175c761786cfc0e49229b8f82f7a9f","integrity":"sha512-aVSp4mPl7mM/g/s0AWQEqA3Uo6oi3WvXgH7qO6xB6Num71evZ7vkuc4F/Yjm72VEoFj25ENCtAY1bfkV+UqqAQ==","tarball":"https://registry.npmjs.org/@20minutes/content-slug/-/content-slug-2.0.1.tgz","fileCount":11,"unpackedSize":13412,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFfZ7VezDg9zbsmX8cDhP7qtxXFGkDJOlx5bcY4G3KW6AiA7MdmQLDdvOI1Zz/32XJ3cthHcCCsDP6XFMg0C3Vs5DA=="}]},"_npmUser":{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},"directories":{},"maintainers":[{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},{"name":"j0k3r","email":"jeremy.benoist@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/content-slug_2.0.1_1775133744802_0.8225514550402835"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-04T09:58:47.449Z","modified":"2026-04-02T12:42:25.169Z","1.0.0":"2022-10-04T09:58:47.645Z","1.0.1":"2022-10-04T10:17:36.157Z","2.0.0":"2026-02-05T14:11:06.023Z","2.0.1":"2026-04-02T12:42:24.970Z"},"license":"MIT","repository":{"type":"git","url":"https://github.com/20minutes/content-slug.git"},"description":"Content slugification for 20 Minutes","maintainers":[{"name":"webtech20minutes","email":"web-tech+npm@20minutes.fr"},{"name":"j0k3r","email":"jeremy.benoist@gmail.com"}],"readme":"# @20minutes/content-slug\n\n[![Build status](https://github.com/20minutes/content-slug/actions/workflows/tests.yml/badge.svg)](https://github.com/20minutes/content-slug/actions/workflows/tests.yml)\n[![NPM](https://img.shields.io/npm/v/@20minutes/content-slug)](https://www.npmjs.com/package/@20minutes/content-slug)\n\nURL slugification used by 20 Minutes for content URL.\n\n## Compatibility\n\n- Requires Node.js >= 22.\n\n## Installation\n\n```bash\nyarn add @20minutes/content-slug\n```\n\n## Usage\n\n```javascript\nimport { toContentSlug, unaccentize} from '@20minutes/content-slug'\n\ntoContentSlug('j'ai mangé des pommes et des poires et c'était bon !')\n// mange-pommes-poires-bon\n\nunaccentize('mangé')\n// mange\n```\n\n## Slug Rules\n\n`toContentSlug` applies the following transformations:\n\n- lowercases the input\n- replaces underscores with spaces before normalization\n- removes diacritics such as `é`, `Å`, or `ç`\n- removes a built-in list of common French stop words\n- collapses punctuation and whitespace through `url-slug`\n- keeps only the slug-safe output produced by `url-slug`\n- truncates the final slug to 150 characters\n- removes trailing hyphens after truncation\n\nExamples:\n\n```javascript\ntoContentSlug(\"le et de ou à\")\n// \"\"\n\ntoContentSlug(\"Bonjour!!!___test??\")\n// \"bonjour-test\"\n\ntoContentSlug(\"À l'école des Ångströms\")\n// \"ecole-angstroms\"\n\ntoContentSlug(\"🍕 Café 東京\")\n// \"cafe\"\n```\n\n`unaccentize` only removes diacritics. It does not slugify, trim, or remove punctuation.\n\n## License\n\n[The MIT License](./LICENSE)\n","readmeFilename":"README.md"}