Socket
Socket
Sign inDemoInstall

@zeit/fetch-cached-dns

Package Overview
Dependencies
16
Maintainers
50
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zeit/fetch-cached-dns

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


Version published
Maintainers
50
Weekly downloads
91,812
decreased by-6.12%

Weekly downloads

Readme

Source

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

FAQs

Last updated on 23 Apr 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc