Follow url redirects
With this Node JS package you can follow all redirects from a given url.
Example
In this example, a bit.ly link has been created that will eventually lead to google.com.
const followRedirects = ; ;
This example returns the following result:
Extra options
There is also the possibility to add extra options as a 2nd parameter.
Option | Default | Description |
---|---|---|
timeout | 10000(ms) | When a request takes too long it stops. In this case after 10 seconds |
maxRedirects | 10 | The maximum number of redirects. |
Example with options
const followRedirects = ; const options = timeout: 3 * 1000 // 3 seconds maxRedirects: 5; ;