Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukekarrys/simple-realurl
Node url lengthener
https://github.com/lukekarrys/simple-realurl
Last synced: 3 days ago
JSON representation
Node url lengthener
- Host: GitHub
- URL: https://github.com/lukekarrys/simple-realurl
- Owner: lukekarrys
- License: mit
- Created: 2013-04-30T21:33:03.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-12-20T02:30:35.000Z (about 7 years ago)
- Last Synced: 2025-01-02T23:49:44.458Z (5 days ago)
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple-realurl
A simple node module to convert short url's to the original url.
[![NPM](https://nodei.co/npm/simple-realurl.png)](https://nodei.co/npm/simple-realurl/)
[![Build Status](https://travis-ci.org/lukekarrys/simple-realurl.png?branch=master)](https://travis-ci.org/lukekarrys/simple-realurl)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)[![Greenkeeper badge](https://badges.greenkeeper.io/lukekarrys/simple-realurl.svg)](https://greenkeeper.io/)
Based off [Manuel van Rijn's original realurl](https://github.com/manuelvanrijn/node-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
```javascript
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.