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

var realurl = require('simple-realurl');
realurl.get('http://goo.gl/BGV9x', function(errorresult) {
   // error = null; 
   // result = "http://github.com/manuelvanrijn/node-realurl"; 
});
 
realurl.get('http://this-is-not-a-real-url.com/at-all', function(errorresult) {
   // error = Error('URL resulted in a 404'); 
   // result = null; 
});
 
realurl.get('', function(errorresult) {
   // error = Error('Please specify a short url'); 
   // result = null; 
});
 
realurl.get('url', {agent: false}, function(errorresult) {
  // bypasses Node's http/s client pool 
});

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

  • 2013/04/30 - v0.1.4 - NEW FORK - Removed all global, bin and copypaste code.
  • 2013/03/19 - v0.1.3 - Async support by @lukekarrys.
  • 2012/10/08 - v0.1.2 - Added copy to clipboard support.
  • 2012/10/03 - v0.1.1 - Fixed a bug regarding line endings...
  • 2012/10/02 - v0.1.0 - Initial release.

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