1 | <p align="center">
|
2 | <h1>🌐 Slugy</h1>
|
3 | <span>Easily slugify url & titles from any ordinary string.</span>
|
4 | </p>
|
5 |
|
6 | [![Standard JS][standard-js-src]][standard-js-href]
|
7 | [![npm version][npm-version-src]][npm-version-href]
|
8 | [![npm downloads][npm-downloads-src]][npm-downloads-href]
|
9 | [![package phobia][package-phobia-src]][package-phobia-href]
|
10 | [![bundle phobia][bundle-phobia-src]][bundle-phobia-href]
|
11 |
|
12 | ## Installation
|
13 |
|
14 | Using yarn:
|
15 |
|
16 | ```bash
|
17 | yarn add slugy
|
18 | ```
|
19 |
|
20 | Using npm:
|
21 |
|
22 | ```bash
|
23 | npm i slugy
|
24 | ```
|
25 |
|
26 | ## Usage
|
27 |
|
28 | ```js
|
29 | const { slugy } = require('slugy');
|
30 |
|
31 | slugy('Hello World'); // hello-world
|
32 |
|
33 | // With options:
|
34 | slugy('Hello World', { separator: '_', lower: false }); // Hello_World
|
35 | ```
|
36 |
|
37 |
|
38 |
|
39 | [standard-js-src]: https://flat.badgen.net/badge/code%20style/standard/green
|
40 | [standard-js-href]: https://standardjs.com
|
41 | [npm-version-src]: https://flat.badgen.net/npm/v/slugy/latest
|
42 | [npm-version-href]: https://npmjs.com/package/slugy
|
43 | [npm-downloads-src]: https://flat.badgen.net/npm/dt/slugy
|
44 | [npm-downloads-href]: https://npmjs.com/package/slugy
|
45 | [package-phobia-src]: https://flat.badgen.net/packagephobia/install/slugy
|
46 | [package-phobia-href]: https://packagephobia.now.sh/result?p=slugy
|
47 | [bundle-phobia-src]: https://flat.badgen.net/bundlephobia/minzip/slugy
|
48 | [bundle-phobia-href]: https://bundlephobia.com/result?p=slugy
|