sluglife (■_■¬)
slugifies string. Handles, unicode, multi-language characters, currency symbols, and more!
Make strings url-safe.
- respecting RFC 3986
- Comprehensive tests
- Coerces foreign symbols to their english equivalent
npm install sluglife
Examples
var slug = === 'i-love-unicode'; === 'unicode-love-is-radioactive'; === 'i_love_unicode'; === 'I-freaking-love-UNICODE'; === 'telephone-number'; === 'i-love-unicode';
Options
;
Defaults
There are two default setting groups. The default mode is 'pretty'
=== 'hello-there-world.'; === 'Hello-There-World';
The default setting groups are defined below.
slugdefaultsmodes'rfc3986' = replacement: '-' replaceSymbols: true remove: null lower: true charmap: slugcharmap multicharmap: slugmulticharmap; slugdefaultsmodes'pretty' = replacement: '-' replaceSymbols: true remove: /[.]/g lower: false charmap: slugcharmap multicharmap: slugmulticharmap;