Skip to content

A JS module for efficiently resolving HTTP/HTTPS redirects

License

Notifications You must be signed in to change notification settings

alonseg/resolve-redirects-efficient

 
 

Repository files navigation

resolve-redirects-efficient

A (node)JS module for efficiently resolving HTTP/HTTPS redirects.

NPM version NPM downloads GitHub issues Tests PRs

What makes this efficient

Unlike the competition, this module does not perform a full HTTP request, but rather performs an HTTP HEAD request in order to receive the headers only.

Only in cases where the server misbehaves (😮‍💨Amazon😮‍💨) it falls back to good old, but heavy, HTTP GET.

Also, there are no dependencies.

Installation

npm install resolve-redirects-efficient

Usage

import resolveRedirect from 'resolve-redirect-efficient'

resolveRedirect('http://bit.ly/1TCI5N0')
  .then(url => console.log(url))

Credits

This is heavily based on the now defunct resolve-redirect by @Cezary.

Say hello!

Come say hello @ devsbedevin.net

License

MIT

About

A JS module for efficiently resolving HTTP/HTTPS redirects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%