1.1.2 • Published 6 years ago

@slynova/slug v1.1.2

Weekly downloads
3,547
License
MIT
Repository
github
Last release
6 years ago

node-slug

Transforms any text into an uri-safe string.


Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm i @slynova/slug
# or
$ yarn add @slynova/slug

Then require the slug() method directly from the package.

const slug = require('@slynova/slug')

slug('1 < 2') // 1-less-2
slug('Hey! How are you') // hey-how-are-you
slug('tôi tên là đức tạ') // toi-ten-la-duc-ta
slug('learn adonis in 30minutes') // learn-adonis-in-30-minutes

Extending char map

To extend the char map you can use the static method extends

const slug = require('@slynova/slug')

slug.extends({'💙': 'love'})
slug('i 💙 you') // i-love-you

Contribution Guidelines

Any pull requests or discussions are welcome. Note that every pull request providing a new feature or correcting a bug should be created with appropriate unit tests.

1.1.2

6 years ago

1.1.1

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago