Last 12 weeks · 0 commits
4 of 6 standards met
Adds a option for callers feeding slugs into URL segments, filenames, and keys with hard length limits — today they truncate the returned slug by hand, which cuts words in half and leaves dangling separators. Semantics: No-op when the finished slug is already within the limit. Otherwise cuts at the rightmost separator boundary at or before the limit ( → ), hard-cutting a single unbroken run ( → ) and with . A truncated slug never ends with the separator. applies the limit to the base slug before the counter suffix, so deduplication is never silently broken by truncation. Anything but a positive integer throws a naming the option. Includes tests for each semantic (22 → 28 passing) and readme + docs in the existing style. Full disclosure: this change was implemented end-to-end by Detent, an autonomous-engineering tool I'm building — every step was gated by this repo's own / suite and independently reviewed before commit. I'm sharing it as a hopefully useful contribution; happy to adjust anything, or to close this and open an issue first if that's your preferred flow. 🤖 Generated with Claude Code
Hello! Thank you for the library. I'm about to start using it and looks good. I have read the README, and while I think is a very good thing to have, what would you think about creating a variant? Using the example in the README: The new variant would produce: section-1 example section-2 section-2-example It would fall back to counters if needed. Example: section-1 example example-2 section-2 section-2-example section-2-example-2 I haven't given this too much thought, though. This is pretty much 100% of what I have thought about. I can give it a shot, if you're willing to accept it. Thanks!
Repository: sindresorhus/slugify. Description: Slugify a string Stars: 2702, Forks: 90. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Topics: browser, nodejs, npm-package, slug, slugify, transliteration, url-safe. Latest release: v3.0.0 (11mo ago). Open PRs: 1, open issues: 1. Last activity: 11mo ago. Community health: 85%. Top contributors: sindresorhus, aegatlin, BendingBender, TiagoDanin, alisonmonteiro, ArfatSalman, CanRau, duruld, hanneskuettner, jfexyz and others.