@tpoisseau/slug
v1.0.1
Published
Use the Unicode Luke 🙌
Downloads
2
Readme
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