Skip to content

skeddles/sluggify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published