urlify.js taken from Django Admin as component module. The original file is here, this is a modified version of the same code with some small enhancements.
Install with component
component install aliem/urlify
the API is simple:
var urlify = require('urlify') urlify('Foo bar bAz '); // 'foo-bar-baz'
The function accepts a second parameter to set the maximum length of the resulting string:
urlify('Foo bar bAz', 5); // 'foo-b'
The library handles different accents for many charsets. Right now it includes:
Released under DJango own license, watch LICENSE for more information.