@vercel/fetch-cached-dns
TypeScript icon, indicating that this package has built-in type declarations

2.1.2 • Public • Published

@vercel/fetch-cached-dns

Build Status

A decorator on top of fetch that caches the DNS query of the hostname of the passed URL.

How to use

const fetch = require('@vercel/fetch-cached-dns')(require('node-fetch'));

Since this implementation is implementing redirects we are providing an onRedirect extra option to the fetch call that gets called with the response object and the options that will be used for the next request. This allows to access the request from outside and to modify the options.

NOTE: if the fetch implementation is not supplied, it will attempt to use peerDep node-fetch

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.2
    21,604
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.2
    21,604
  • 2.1.1
    0
  • 2.1.0
    30,022
  • 2.0.2
    32,129
  • 2.0.1
    938
  • 2.0.0
    0

Package Sidebar

Install

npm i @vercel/fetch-cached-dns

Weekly Downloads

84,693

Version

2.1.2

License

MIT

Unpacked Size

6.29 kB

Total Files

6

Last publish

Collaborators

  • ijjk
  • quietshu
  • vercel-release-bot
  • snokohn
  • nick.tracey
  • matheuss
  • chriswdmr
  • matt.straka
  • zeit-bot