simple-slugify
Slugify a string, simply replace "Reserved characters", and "Unsafe characters" to "-".
Usage
const slugify = // i-♥ // 大好き_♥
<!-- browser side -->
Options
// a---b // a-- b // -A__--b-
See more options and details at ./src/index.js
const defaultOptions
Advanced Usage
const Slugify = const s = // memorize slug, make sure the returning slug is uniques // 大好き-♥s // 大好き-♥.1 ss // 大好き-♥s // 大好き_♥s // 大好き_♥_1s // 大好き_♥_1_1
<!-- browser side -->
Why
This lib focus on world wide human readable url, doesn't translate things to English. The non-english native people actually don't know too much English as programmers thought. So this lib converts characters only if necessary, only cover reserved, unsafe characters.
If you are looking for lib translating characters, please consider https://github.com/simov/slugify.