1.0.1 • Published 5 years ago

@tpoisseau/slug v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

js-slug

This package as no dependency and let you transform any string with special chars into a nice string with only Alpha, Digits and dash caracters. Typical use : Transform a title into a url segment.

Usage

If you use npm, you'll need node >12 because it's a ESM.

  • npm install @tpoisseau/slug
import slug from '@tpoisseau/slug';

If you wan't use it directly in browser

import slug from 'https://github.com/tpoisseau/js-slug/blob/1.0.0/index.mjs';

And then

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

5 years ago

1.0.0

5 years ago