url-unshorten
Checks urls that might be shorten and returns all the potential redirects until its unshorten.
Installation
npm i url-unshorten
Usage
The url-unshorten
module exports a function that accepts a url and returns a promise that resolves with the array of the potential urls that redirect to the resolved unshorten one. For convenience it also outputs the unshorten url.
Example usage
const unshort = ; ;
The above snippet will output the following:
urls: 'https://t.co/wy9S5P0Cd2' 'https://nyti.ms/2KO3tC7' 'https://trib.al/WeJspBJ' 'https://www.nytimes.com/2018/07/10/sports/world-cup/england-croatia-france-belgium.html?smtyp=cur&smid=tw-nytimes' unshorten: 'https://www.nytimes.com/2018/07/10/sports/world-cup/england-croatia-france-belgium.html?smtyp=cur&smid=tw-nytimes'