// expand an URL
const unshortener = require("unshortener");
// you can pass in a url object or string
unshortener.expand("http://t.co/rWP6BP3", (_err, url) => {
// url is a url object
console.log(url);
});
Gives:
Url {
protocol: 'https:',
slashes: true,
auth: null,
host: 'www.facebook.com',
port: 443,
hostname: 'www.facebook.com',
hash: null,
search: null,
query: null,
pathname: '/unsupportedbrowser',
path: '/unsupportedbrowser',
href: 'https://www.facebook.com/unsupportedbrowser'
}
Gives: