GitShow/sindresorhus/slugify
sindresorhus

slugify

Slugify a string

by sindresorhus
browsernodejsnpm-packageslugslugifytransliterationurl-safe
Star on GitHubForknpm

JavaScript

2.7k stars90 forks19 contributorsQuiet · 11mo agoSince 2018v3.0.0MIT

Meet the team

See all 19 on GitHub →
sindresorhus
sindresorhus49 contributions
aegatlin
aegatlin3 contributions
BendingBender
BendingBender2 contributions
TiagoDanin
TiagoDanin2 contributions
alisonmonteiro
alisonmonteiro1 contribution
ArfatSalman
ArfatSalman1 contribution
CanRau
CanRau1 contribution
duruld
duruld1 contribution

Languages

View on GitHub →
JavaScript100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 1 in progress · Last activity 11mo ago
See all on GitHub →
AmineYagoub
Add `maxLength` optionOpenPR

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

AmineYagoub · 2d ago

Recent fixes

View closed PRs →
webJose
Would you be open to a new variant of slugify?ClosedIssue

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!

webJose · 1mo ago
Catsvilles
Truncate string input?ClosedIssue

Is it possible to truncate the output of the "slugified" string if it's way too long? Thanks!

Catsvilles · 6mo ago
dlamb3241-create
Normalize duplicate separators in slug outputMergedPR
dlamb3241-create · 7mo ago
Structured data for AI agents

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.

·@ofershap

Replace github.com with gitshow.dev