Skip to content

Slynova-Org/slug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

🔗 Transforms any text into an uri-safe string

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published