Slugify a string
Useful for URLs, filenames, and IDs.
$ npm install @sindresorhus/slugify
const slugify = require('@sindresorhus/slugify');
slugify('I ♥ Dogs');
//=> 'i-love-dogs'
slugify(' Déjà Vu! ');
//=> 'deja-vu'
slugify('fooBar 123 $#%');
//=> 'foo-bar-123'
slugify('BAR and baz', {separator: '_'});
//=> 'bar_and_baz'
Type: string
Type: Object
Type: string
Default: -
- filenamify - Convert a string to a valid safe filename
MIT © Sindre Sorhus