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 10.1.0 to 10.1.1

2

lib/dns.js

@@ -8,3 +8,3 @@ const LRUCache = require('lru-cache')

all: false,
verbatim: true,
verbatim: undefined,
}

@@ -11,0 +11,0 @@

{
"name": "make-fetch-happen",
"version": "10.1.0",
"version": "10.1.1",
"description": "Opinionated, caching, retrying fetch client",

@@ -58,3 +58,3 @@ "main": "lib/index.js",

"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "3.1.2",
"@npmcli/template-oss": "3.2.0",
"mkdirp": "^1.0.4",

@@ -77,4 +77,4 @@ "nock": "^13.2.4",

"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.1.2"
"version": "3.2.0"
}
}

@@ -187,41 +187,2 @@ # make-fetch-happen

A possible (minimal) implementation for `MyCustomRedisCache`:
```javascript
const bluebird = require('bluebird')
const redis = require("redis")
bluebird.promisifyAll(redis.RedisClient.prototype)
class MyCustomRedisCache {
constructor (opts) {
this.redis = redis.createClient(opts)
}
match (req) {
return this.redis.getAsync(req.url).then(res => {
if (res) {
const parsed = JSON.parse(res)
return new fetch.Response(parsed.body, {
url: req.url,
headers: parsed.headers,
status: 200
})
}
})
}
put (req, res) {
return res.buffer().then(body => {
return this.redis.setAsync(req.url, JSON.stringify({
body: body,
headers: res.headers.raw()
}))
}).then(() => {
// return the response itself
return res
})
}
'delete' (req) {
return this.redis.unlinkAsync(req.url)
}
}
```
#### <a name="opts-cache"></a> `> opts.cache`

@@ -228,0 +189,0 @@

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