Skip to content

Commit efd1e2f

Browse files
committed
docs: update readme
1 parent 7c25367 commit efd1e2f

File tree

1 file changed

+3
-30
lines changed

1 file changed

+3
-30
lines changed

README.md

+3-30
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,12 @@ fetch('https://registry.npmjs.org/make-fetch-happen').then(res => {
6262
* Quite fast, really
6363
* Automatic HTTP-semantics-aware request retries
6464
* Cache-fallback automatic "offline mode"
65-
* Proxy support (http, https, socks, socks4, socks5)
6665
* Built-in request caching following full HTTP caching rules (`Cache-Control`, `ETag`, `304`s, cache fallback on error, etc).
6766
* Node.js Stream support
6867
* Transparent gzip and deflate support
6968
* [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) support
70-
* Literally punches nazis
71-
* Built in DNS cache
72-
* (PENDING) Range request caching and resuming
73-
74-
### Contributing
75-
76-
The make-fetch-happen team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The [Contributor Guide](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md) outlines the process for community interaction and contribution. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.
77-
78-
All participants and maintainers in this project are expected to follow the [npm Code of Conduct](https://www.npmjs.com/policies/conduct), and just generally be excellent to each other.
79-
80-
Please refer to the [Changelog](CHANGELOG.md) for project history details, too.
81-
82-
Happy hacking!
83-
84-
### API
69+
* Proxy support (http, https, socks, socks4, socks5. via [`@npmcli/agent`](https://npm.im/@npmcli/agent))
70+
* DNS cache (via ([`@npmcli/agent`](https://npm.im/@npmcli/agent))
8571

8672
#### <a name="fetch"></a> `> fetch(uriOrRequest, [opts]) -> Promise<Response>`
8773

@@ -126,11 +112,6 @@ The following options for `minipass-fetch` are used as-is:
126112
These other options are modified or augmented by make-fetch-happen:
127113

128114
* headers - Default `User-Agent` set to make-fetch happen. `Connection` is set to `keep-alive` or `close` automatically depending on `opts.agent`.
129-
* agent
130-
* If agent is null, an http or https Agent will be automatically used. By default, these will be `http.globalAgent` and `https.globalAgent`.
131-
* If [`opts.proxy`](#opts-proxy) is provided and `opts.agent` is null, the agent will be set to an appropriate proxy-handling agent.
132-
* If `opts.agent` is an object, it will be used as the request-pooling agent argument for this request.
133-
* If `opts.agent` is `false`, it will be passed as-is to the underlying request library. This causes a new Agent to be spawned for every request.
134115

135116
For more details, see [the documentation for `minipass-fetch` itself](https://github.com/npm/minipass-fetch#options).
136117

@@ -150,6 +131,7 @@ make-fetch-happen augments the `minipass-fetch` API with additional features ava
150131
* [`opts.onRetry`](#opts-onretry) - a function called whenever a retry is attempted
151132
* [`opts.integrity`](#opts-integrity) - [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) metadata.
152133
* [`opts.dns`](#opts-dns) - DNS cache options
134+
* [`opts.agent`](#opts-agent) - http/https/proxy/socks agent options. See [`@npmcli/agent`](https://npm.im/@npmcli/agent) for more info.
153135

154136
#### <a name="opts-cache-path"></a> `> opts.cachePath`
155137

@@ -380,12 +362,3 @@ fetch('https://malicious-registry.org/make-fetch-happen/-/make-fetch-happen-1.0.
380362
integrity: 'sha1-o47j7zAYnedYFn1dF/fR9OV3z8Q='
381363
}) // Error: EINTEGRITY
382364
```
383-
384-
#### <a name="opts-dns"></a> `> opts.dns`
385-
386-
An object that provides options for the built-in DNS cache. The following options are available:
387-
388-
Note: Due to limitations in the current proxy agent implementation, users of proxies will not benefit from the DNS cache.
389-
390-
* `ttl`: Milliseconds to keep cached DNS responses for. Defaults to `5 * 60 * 1000` (5 minutes)
391-
* `lookup`: A custom lookup function, see [`dns.lookup()`](https://nodejs.org/api/dns.html#dnslookuphostname-options-callback) for implementation details. Defaults to `require('dns').lookup`.

0 commit comments

Comments
 (0)