1.0.2 • Published 6 years ago

hive-slug v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

hive-slug

The following options exist:

{
    removeTrailingSpaces: true,
    remove: /[^0-9A-Za-z\-\+\_]+/g,
    replacement: '-',
    lower: true
}

Usage

const slug = require('hive-slug');

slug(' Hello World '); // output: hello-world
slug(' Hello World ', { replacement: '_ '}); // output: hello_world

Options

Replacement

You can pass in any string of your choice. Trailing hyphens and underscores will be removed.

Remove trailing spaces

If you don't want trailing spaces to be removed, you can pass removeTrailingSpaces: false in the options object

Remove

By default, all characters that are not alphanumeric, underscores and hyphens

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago