Simple URL shortener client library

npm install shorturl
1 downloads in the last day
15 downloads in the last week
33 downloads in the last month
Simple URL shortener client library for node.js

[shorturl]( is a simple, asynchronous client library for common URL shortener services. It currently supports:,,,, and string substitution links (with %@). It includes a perky little script for shortening URLs on the command line, also named [shorturl](

If you [need to go deeper](, try the more complete client libraries for individual services such as [node-bitly]( or [node-googl](

## Requirements

You can install node-shorturl and its dependencies with npm: `npm install shorturl`. Otherwise, manually install:

- [node]( 0.6+
- [request]( 2.9+
- [optimist]( 0.3.1

## Examples

	var shorturl = require('shorturl');
	shorturl('', function(result) {

By default it will shorten URLs with, but you can choose an alternative service and pass parameters:

	shorturl('', '', {
		login: 'STATE YOUR NAME',
	}, function(result) {

Simple services can be described using a string substitution link. Pass the entire link as the service name; '%@' will be replaced with your URL:

	var arsehat = '';
	shorturl('', arsehat, function(result) {

## Command line script

	$ shorturl
	Usage: shorturl [options] <longurl>

	$ shorturl --key=STATE_YOUR_ID_NUMBER

	$ shorturl --service=$ARSEHAT

Display the built-in command line documentation with `shorten --help`.
npm loves you