nano-slug
v1.0.1
Published
The smallest, most efficient URL-slug generator using modern String.prototype.normalize
Maintainers
Readme
nano-slug
The smallest, most efficient URL-slug generator using modern String.prototype.normalize.
Installation
npm install nano-slugUsage
import { slugify } from 'nano-slug';
slugify('Hello World'); // => 'hello-world'
slugify('Café Résumé'); // => 'cafe-resume'
slugify('Rock & Roll'); // => 'rock-and-roll'
slugify('Title', { separator: '_' }); // => 'title'
slugify('Long Title', { maxLength: 5 }); // => 'long'Options
separator- Character separator (default:-)maxLength- Maximum length truncationreplacements- Custom character replacements
License
MIT
