Skip to content

🍢 The simplest slugify module in the universe.

License

Notifications You must be signed in to change notification settings

busterc/skewered

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 23, 2018
74e3626 · Jan 23, 2018

History

1 Commit
Jan 23, 2018
Jan 23, 2018
Jan 23, 2018
Jan 23, 2018
Jan 23, 2018
Jan 23, 2018
Jan 23, 2018
Jan 23, 2018
Jan 23, 2018
Jan 23, 2018

Repository files navigation

skewered NPM version Build Status Dependency Status Coverage percentage

The simplest slugify module in the universe.

Prerequisites

Any input character that is not a-z, 0-9 or - will be lowercased or replaced with a hyphen.

  • Therefore, use other modifiers beforehand, e.g. diacritics

Resulting values:

  • Only contain a-z, 0-9, -
  • Do not contain leading or trailing hyphens
  • Do not contain repeating hyphens

Installation

$ npm install skewered

Usage

const skewered = require("skewered");
const before =
  "- (this),is.a+test-that*must:work;or&else#it%fails big/*/time  1'2'3 123--xyz----Möbius _";
const after =
  "this-is-a-test-that-must-work-or-else-it-fails-big-time-1-2-3-123-xyz-m-bius";

console.log(skewered(before) === after);
//=> true

License

ISC © Buster Collings