url-unshorten

1.0.6 • Public • Published

url-unshorten

CircleCI Known Vulnerabilities FOSSA Status

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 = require('url-unshorten');
 
unshort('https://t.co/wy9S5P0Cd2')
  .then(console.log)
  .catch(console.log);

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'
}

License

FOSSA Status

/url-unshorten/

    Package Sidebar

    Install

    npm i url-unshorten

    Weekly Downloads

    16

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    6.8 kB

    Total Files

    9

    Last publish

    Collaborators

    • dinostheo