Question
What configuration options does the slugify function accept?
About sindresorhus/slugify · 2 messages · last activity 6/8/2026
What configuration options does the slugify function accept?
Based on the README, the slugify function accepts an optional options object with the following configuration properties:
separator (string, default: '-')
slugify('BAR and baz', {separator: '_'}) → 'bar_and_baz'lowercase (boolean, default: true)
slugify('Déjà Vu!', {lowercase: false}) → 'Deja-Vu'decamelize (boolean, default: true)
fooBar → foo bar)slugify('fooBar', {decamelize: false}) → 'foobar'customReplacements (Array<string[]>, default: [['&', ' and '], ['🦄', ' unicorn '], ['♥', ' love ']])
slugify('Foo@unicorn', {customReplacements: [['@', 'at']]}) → 'fooatunicorn'preserveLeadingUnderscore (boolean, default: false)
FOLLOW_UPS:
Want to ask your own question?
Open chat for sindresorhus/slugify →Public Q&A. Generated by RepoPilot from the actual source of sindresorhus/slugify. AI answers can be incomplete or stale — verify before relying on them.