slugify – Slugify a String with Javascript

10/23/2018
javascript , url , utility , string format , string , file name , slugify

slugify – Slugify a String with Javascript

slugify is a javascript library to slugify string. It's useful for URLs, filenames, and IDs.

Usage:

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'

Leave a Reply

If you leave a message for the first time on this site, the audit will need to display the contents!