node package manager

simple-realurl

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

simple-realurl

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

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

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

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 
});

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