1.3.0 • Published 2 years ago
nodejs-follow-redirects v1.3.0
nodejs-follow-redirects
Nodejs module that automatically follows redirects up to 10 redirects.
Installation
npm i nodejs-follow-redirects
Usage
const follow = require('nodejs-follow-redirects')
follow('http://bit.ly/900913')
.then(r => console.log(r))
output
[
{
url: 'http://bit.ly/900913',
redirect: true,
status: 302,
redirectUrl: 'https://bitly.com/a/blocked?hash=2qYwC4&url=http%3A%2F%2Fwww.alideas.com%2F'
},
{
url: 'https://bitly.com/a/blocked?hash=2qYwC4&url=http%3A%2F%2Fwww.alideas.com%2F',
redirect: false,
status: 200
}
]
Inspired from https://www.npmjs.com/package/linkfollower