Node url lengthener
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
package.json

README.md

simple-realurl

A simple node module to convert short url's to the original url.

NPM Build Status JavaScript Style Guide

Greenkeeper badge

Based off Manuel van Rijn's original realurl, I created this to remove some dependencies (copypaste) and any global bin files.

Getting Started

Install the module with: npm install simple-realurl --save

Within your NodeJS project

var realurl = require('simple-realurl');
realurl.get('http://goo.gl/BGV9x', function(error, result) {
   // error = null;
   // result = "http://github.com/manuelvanrijn/node-realurl";
});

realurl.get('http://this-is-not-a-real-url.com/at-all', function(error, result) {
   // error = Error('URL resulted in a 404');
   // result = null;
});

realurl.get('', function(error, result) {
   // error = Error('Please specify a short url');
   // result = null;
});

realurl.get('url', {agent: false}, function(error, result) {
  // bypasses Node's http/s client pool
});

License

Copyright (c) 2012 Manuel van Rijn - Licensed under the MIT license. Copyright (c) 2012-2016 Luke Karrys - Licensed under the MIT license.