1.0.6 • Published 5 years ago

url-unshorten v1.0.6

Weekly downloads
31
License
MIT
Repository
github
Last release
5 years ago

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

1.0.6

5 years ago

1.0.4

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago