@kainiedziela/slugize

1.0.0 • Public • Published

slugize

Convert sentences, titles and special characters to a url/filename/id-appropiate and readable slug.

Installation

npm install @kainiedziela/slugize --save

Usage

import { slugize } from '@kainiedziela/sunday';

const slug = slugize(string);

slugize(string) returns a string that had replaced special characters with latin alternatives, replaced spaces with dashes, removed periods, replaced non-alphanumerical characters with dashes, condensed consecutive dashes, lowercased and with the begging and end trimmed (so that the string doesn't start or end with a dash).

Testing

Tests are performed with Jest.

npm run test

This project is under the MIT license.

Package Sidebar

Install

npm i @kainiedziela/slugize

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.66 kB

Total Files

6

Last publish

Collaborators

  • kainiedziela