TinyURL
http://TinyURL.com URL Shortener Node.js Module
Example Shorten:
First run npm install TinyURL
to install the TinyURL package to your system.
var TinyURL = require('tinyurl');
TinyURL.shorten('http://google.com', function(res, err) {
if (err)
console.log(err)
console.log(res);
});
const data = { 'url': 'https://google.com', 'alias': 'custom-alias-for-google' }
TinyURL.shortenWithAlias(data, function(res, err) {
if (err)
console.log(err)
console.log(res);
});
TinyURL.shorten('http://google.com').then(function(res) {
console.log(res)
}, function(err) {
console.log(err)
})
const data = { 'url': 'https://google.com', 'alias': 'custom-alias-for-google' }
TinyURL.shortenWithAlias(data).then(function(res) {
console.log(res)
}, function(err) {
console.log(err)
})
TinyURL.resolve("https://tinyurl.com/2tx").then(
function(res) {
console.log(res);
},
function(err) {
console.log(err);
}
);
This Package Is Licensed Under The MIT License