diff options
Diffstat (limited to 'deps/npm/node_modules/pacote/node_modules/make-fetch-happen/README.md')
-rw-r--r-- | deps/npm/node_modules/pacote/node_modules/make-fetch-happen/README.md | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/README.md index 7160fa8389..4d12d8dae7 100644 --- a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/README.md +++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/README.md @@ -2,8 +2,8 @@ [`make-fetch-happen`](https://github.com/zkat/make-fetch-happen) is a Node.js -library that wraps [`node-fetch`](https://npm.im/node-fetch) with additional -features it doesn't intend to include, including HTTP Cache support, request +library that wraps [`node-fetch-npm`](https://github.com/npm/node-fetch-npm) with additional +features [`node-fetch`](https://github.com/bitinn/node-fetch) doesn't intend to include, including HTTP Cache support, request pooling, proxies, retries, [and more](#features)! ## Install @@ -27,6 +27,7 @@ pooling, proxies, retries, [and more](#features)! * [`opts.ca, opts.cert, opts.key`](#https-opts) * [`opts.maxSockets`](#opts-max-sockets) * [`opts.retry`](#opts-retry) + * [`opts.onRetry`](#opts-onretry) * [`opts.integrity`](#opts-integrity) * [Message From Our Sponsors](#wow) @@ -143,6 +144,7 @@ make-fetch-happen augments the `node-fetch` API with additional features availab * [`opts.localAddress`](#opts-local-address) * [`opts.maxSockets`](#opts-max-sockets) * [`opts.retry`](#opts-retry) - Request retry settings +* [`opts.onRetry`](#opts-onretry) - a function called whenever a retry is attempted * [`opts.integrity`](#opts-integrity) - [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) metadata. #### <a name="opts-cache-manager"></a> `> opts.cacheManager` @@ -363,6 +365,20 @@ fetch('http://one-more.site.com', { }) ``` +#### <a name="opts-onretry"></a> `> opts.onRetry` + +A function called whenever a retry is attempted. + +##### Example + +```javascript +fetch('https://flaky.site.com', { + onRetry() { + console.log('we will retry!') + } +}) +``` + #### <a name="opts-integrity"></a> `> opts.integrity` Matches the response body against the given [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) metadata. If verification fails, the request will fail with an `EINTEGRITY` error. @@ -376,7 +392,7 @@ fetch('https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-1.0.0.tg integrity: 'sha1-o47j7zAYnedYFn1dF/fR9OV3z8Q=' }) // -> ok -fetch('https://malicious-registry.org/make-fetch-happen/-/make-fetch-happen-1.0.0.tgz'. { +fetch('https://malicious-registry.org/make-fetch-happen/-/make-fetch-happen-1.0.0.tgz', { integrity: 'sha1-o47j7zAYnedYFn1dF/fR9OV3z8Q=' }) // Error: EINTEGRITY ``` |