Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

make-fetch-happen

Package Overview
Dependencies
Maintainers
6
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

make-fetch-happen - npm Package Compare versions

Comparing version 11.1.1 to 12.0.0

10

lib/remote.js

@@ -7,3 +7,3 @@ const { Minipass } = require('minipass')

const CachingMinipassPipeline = require('./pipeline.js')
const getAgent = require('./agent.js')
const { getAgent } = require('@npmcli/agent')
const pkg = require('../package.json')

@@ -18,5 +18,11 @@

'ETIMEDOUT', // someone in the transaction is WAY TOO SLOW
'ERR_SOCKET_TIMEOUT', // same as above, but this one comes from agentkeepalive
// from @npmcli/agent
'ECONNECTIONTIMEOUT',
'EIDLETIMEOUT',
'ERESPONSETIMEOUT',
'ETRANSFERTIMEOUT',
// Known codes we do NOT retry on:
// ENOTFOUND (getaddrinfo failure. Either bad hostname, or offline)
// EINVALIDPROXY // invalid protocol from @npmcli/agent
// EINVALIDRESPONSE // invalid status code from @npmcli/agent
]

@@ -23,0 +29,0 @@

22

package.json
{
"name": "make-fetch-happen",
"version": "11.1.1",
"version": "12.0.0",
"description": "Opinionated, caching, retrying fetch client",

@@ -36,10 +36,7 @@ "main": "lib/index.js",

"dependencies": {
"agentkeepalive": "^4.2.1",
"@npmcli/agent": "^1.1.0",
"cacache": "^17.0.0",
"http-cache-semantics": "^4.1.1",
"http-proxy-agent": "^5.0.0",
"https-proxy-agent": "^5.0.0",
"is-lambda": "^1.0.1",
"lru-cache": "^7.7.1",
"minipass": "^5.0.0",
"minipass": "^7.0.2",
"minipass-fetch": "^3.0.0",

@@ -50,3 +47,2 @@ "minipass-flush": "^1.0.5",

"promise-retry": "^2.0.1",
"socks-proxy-agent": "^7.0.0",
"ssri": "^10.0.0"

@@ -56,3 +52,3 @@ },

"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.14.1",
"@npmcli/template-oss": "4.18.0",
"nock": "^13.2.4",

@@ -64,3 +60,3 @@ "safe-buffer": "^5.2.1",

"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
"node": "^16.13.0 || >=18.0.0"
},

@@ -79,5 +75,11 @@ "tap": {

"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.14.1",
"ciVersions": [
"16.13.0",
"16.x",
"18.0.0",
"18.x"
],
"version": "4.18.0",
"publish": "true"
}
}

@@ -65,3 +65,2 @@ # make-fetch-happen

* Cache-fallback automatic "offline mode"
* Proxy support (http, https, socks, socks4, socks5)
* Built-in request caching following full HTTP caching rules (`Cache-Control`, `ETag`, `304`s, cache fallback on error, etc).

@@ -71,18 +70,5 @@ * Node.js Stream support

* [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) support
* Literally punches nazis
* Built in DNS cache
* (PENDING) Range request caching and resuming
* Proxy support (http, https, socks, socks4, socks5. via [`@npmcli/agent`](https://npm.im/@npmcli/agent))
* DNS cache (via ([`@npmcli/agent`](https://npm.im/@npmcli/agent))
### Contributing
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.
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.
Please refer to the [Changelog](CHANGELOG.md) for project history details, too.
Happy hacking!
### API
#### <a name="fetch"></a> `> fetch(uriOrRequest, [opts]) -> Promise<Response>`

@@ -131,7 +117,2 @@

* headers - Default `User-Agent` set to make-fetch happen. `Connection` is set to `keep-alive` or `close` automatically depending on `opts.agent`.
* agent
* If agent is null, an http or https Agent will be automatically used. By default, these will be `http.globalAgent` and `https.globalAgent`.
* If [`opts.proxy`](#opts-proxy) is provided and `opts.agent` is null, the agent will be set to an appropriate proxy-handling agent.
* If `opts.agent` is an object, it will be used as the request-pooling agent argument for this request.
* 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.

@@ -156,2 +137,3 @@ For more details, see [the documentation for `minipass-fetch` itself](https://github.com/npm/minipass-fetch#options).

* [`opts.dns`](#opts-dns) - DNS cache options
* [`opts.agent`](#opts-agent) - http/https/proxy/socks agent options. See [`@npmcli/agent`](https://npm.im/@npmcli/agent) for more info.

@@ -387,10 +369,1 @@ #### <a name="opts-cache-path"></a> `> opts.cachePath`

```
#### <a name="opts-dns"></a> `> opts.dns`
An object that provides options for the built-in DNS cache. The following options are available:
Note: Due to limitations in the current proxy agent implementation, users of proxies will not benefit from the DNS cache.
* `ttl`: Milliseconds to keep cached DNS responses for. Defaults to `5 * 60 * 1000` (5 minutes)
* `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`.
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc