sluggr
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

sluggr

JS light slugger 875 B (gzipped: 495 B)

How to use

const sluggr = require('sluggr');
 
// sluggr(char = "_", whitelist = "", shouldNormalize = true)
const slugger = sluggr("-", ":;");
 
> slugger("WDAè: ô*")
"wdae:-o"

shouldNormalize

If shouldNormalize is set to false, sluggr will no longer replace é by e etc. and those characters will be considered as whitespaces, so you'll have to set them in the whitelist string

const sluggr = require('sluggr');
 
const slugger = sluggr("-", "ô", false);
 
> slugger("WDAè: ô*")
"wda:-ô"

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i sluggr

      Weekly Downloads

      13

      Version

      1.2.1

      License

      MIT

      Unpacked Size

      3.43 kB

      Total Files

      5

      Last publish

      Collaborators

      • ayc0