# @zeit/fetch-cached-dns

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

Latest version **1.2.1** (published 2019-04-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zeit/fetch-cached-dns
pnpm add @zeit/fetch-cached-dns
yarn add @zeit/fetch-cached-dns
bun add @zeit/fetch-cached-dns
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2019-04-23 |
| First published | 2017-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 41 |
| Author | Nathan Rajlich |
| Maintainers | alexaltea, amio, anatrajkovska, andybitz, arunoda, arzafran, b3nnyl, bluebill1049, caarlos0, codetheory, coetry, dav-is, fivepointseven, hharnisc, huvik, iamevilrabbit, igorklopov, ijjk, javivelasco, joecohens, juancampa, kikobeats, leo, lfades, lipp, lucleray, manovotny, matheuss, mfix22, mglagola, msweeneydev, nkzawa, olliv, paulogdm, quietshu, rabaut, ragojose, rauchg, sarupbanskota, sophearak, sospedra, styfle, tejaskumar, timer, timneutkens, tootallnate, umegaya, williamli, yukims19, zeit-bot |

## Links

- npm: https://www.npmjs.com/package/@zeit/fetch-cached-dns
- Repository: https://github.com/zeit/fetch-cached-dns
- Homepage: https://github.com/zeit/fetch-cached-dns#readme
- Issues: https://github.com/zeit/fetch-cached-dns/issues
- npm.io page: https://npm.io/package/@zeit/fetch-cached-dns

## Dependencies (2)

- [@types/node-fetch](https://npm.io/package/@types/node-fetch.md) 2.3.2
- [@zeit/dns-cached-resolve](https://npm.io/package/@zeit/dns-cached-resolve.md) 2.1.0

## Recent versions

- 1.2.1 (latest) — 2019-04-23
- 1.2.0 — 2019-02-04
- 1.1.4 — 2018-06-22
- 1.1.3 — 2018-04-26
- 1.1.2 — 2018-03-28
- 1.1.1 — 2018-03-28
- 1.1.0 — 2018-03-28
- 1.0.3 — 2017-11-16
- 1.0.2 — 2017-11-16
- 1.0.1 — 2017-11-05
- 1.0.0 — 2017-10-19

## README

# fetch-cached-dns

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

## How to use

```js
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`*

---
_Source: https://npm.io/package/@zeit/fetch-cached-dns · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
