https://github.com/busterc/skewered
:oden: The simplest slugify module in the universe.
https://github.com/busterc/skewered
dash-case dashcase hyphenate hyphenation kebab-case slug slugify urlify
Last synced: about 2 months ago
JSON representation
:oden: The simplest slugify module in the universe.
- Host: GitHub
- URL: https://github.com/busterc/skewered
- Owner: busterc
- License: isc
- Created: 2018-01-23T21:12:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-25T21:55:59.000Z (over 6 years ago)
- Last Synced: 2024-04-25T04:01:27.065Z (about 1 year ago)
- Topics: dash-case, dashcase, hyphenate, hyphenation, kebab-case, slug, slugify, urlify
- Language: JavaScript
- Size: 41 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# skewered [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
> 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`](https://www.npmjs.com/package/diacritics)
Resulting values:
* Only contain `a-z`, `0-9`, `-`
* Do not contain leading or trailing hyphens
* Do not contain repeating hyphens## Installation
```sh
$ npm install skewered
```## Usage
```js
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](https://about.me/buster)
[npm-image]: https://badge.fury.io/js/skewered.svg
[npm-url]: https://npmjs.org/package/skewered
[travis-image]: https://travis-ci.org/busterc/skewered.svg?branch=master
[travis-url]: https://travis-ci.org/busterc/skewered
[daviddm-image]: https://david-dm.org/busterc/skewered.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/busterc/skewered
[coveralls-image]: https://coveralls.io/repos/busterc/skewered/badge.svg
[coveralls-url]: https://coveralls.io/r/busterc/skewered