@skeddles/sluggify
v1.0.1
Published
converts a string into slug
Downloads
1
Readme
Sluggify
Takes a string, and turns it into a slug (letters, numbers and dashes only).
This utility doesn't just remove non-matching characters, but tries to find english letter replacements for many accented letters.
Currently only works for node.js, not browsers.
Usage
First, install with
npm i @skeddles/sluggify
Then just require it as a node module. It will return a syncronous function which takes in your input string, and returns the newly made slug.
const sluggify = require('@skeddles/sluggify');
let slug = sluggify('Pokémon Red');
console.log(slug);
Outputs:
pokemon-red