Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
urlify.js taken from Django Admin modified to be included as component.js module
JavaScript
branch: master

change npm name

it's not conventional but npm is beginning to be very crowded
latest commit 6d1111cde1
@aliem authored

Readme.md

urlify.js

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:

  • Latin
  • Greek
  • Turkish
  • Russian
  • Ukranian
  • Czech
  • Polish
  • Latvian

In modern ES6 capable javascript engines like v8, all of Unicode is supported.

License

Released under DJango own license, watch LICENSE for more information.

Something went wrong with that request. Please try again.