JSPM

resolve-redirects-efficient

0.0.8
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 58
  • Score
    100M100P100Q88818F
  • License MIT

A JS module for efficiently resolving HTTP/HTTPS redirects

Package Exports

  • resolve-redirects-efficient
  • resolve-redirects-efficient/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (resolve-redirects-efficient) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

resolve-redirects-efficient

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

What makes this efficient

Unlike the competition, this module does not request the URL itself, 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