Skip to content

A decorator on top of `fetch` that caches the DNS query which resolves using Google DNS-OVER-HTTPS

License

Notifications You must be signed in to change notification settings

j-usti-n/fetch-cached-dns

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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('@kulaj/fetch-cached-dns')()

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

About

A decorator on top of `fetch` that caches the DNS query which resolves using Google DNS-OVER-HTTPS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%