urlize

Convert strings to be used as urls

npm install urlize
1 downloads in the last day
4 downloads in the last week
16 downloads in the last month

urlize

An urlize module for Node.js. Turns a string into a string that can be used more easily as an URL.

  1. Turns everything into lowercase
  2. Removes accents: äöå -> aoa
  3. Removes other characters than (i.e. keeps the following characters): a-z 0-9 . _ - ( ) /
  4. Trims the string

Usage

npm install git://github.com/ile/urlize.git

var urlize = require('urlize').urlize;

urlize(" ääliö älä lyö, ööliä läikkyy.HTML");
// aalio-ala-lyo-oolia-laikkyy.html

Drawbacks

Doesn't handle many foreign characters.

npm loves you