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

1.2.1 • Public • Published

fetch-cached-dns

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

How to use

const fetch = require('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

/@zeit/fetch-cached-dns/

    Package Sidebar

    Install

    npm i @zeit/fetch-cached-dns

    Weekly Downloads

    83,837

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    5.13 kB

    Total Files

    6

    Last publish

    Collaborators

    • gdborton
    • matheuss
    • matt.straka
    • nick.tracey
    • zeit-bot
    • vercel-release-bot