57

GitHub - sindresorhus/slugify: Slugify a string

 6 years ago
source link: https://github.com/sindresorhus/slugify
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

readme.md

slugify Build Status

Slugify a string

Useful for URLs, filenames, and IDs.

Install

$ npm install @sindresorhus/slugify

Usage

const slugify = require('@sindresorhus/slugify');

slugify('I ♥ Dogs');
//=> 'i-love-dogs'

slugify('  Déjà Vu!  ');
//=> 'deja-vu'

slugify('fooBar 123 $#%');
//=> 'foo-bar-123'

Related

  • filenamify - Convert a string to a valid safe filename

License

MIT © Sindre Sorhus


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK