-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/preset-env"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package-lock.json | ||
node_modules/* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"use strict"; | ||
|
||
var fetch = require("make-fetch-happen").defaults({ | ||
cachePath: "./my-cache" // path where cache will be written (and read) | ||
}); | ||
fetch("https://registry.npmjs.org/make-fetch-happen").then(function (res) { | ||
return res.json(); // download the body as JSON | ||
}).then(function (body) { | ||
console.log("got ".concat(body.name, " from web")); | ||
return fetch("https://registry.npmjs.org/make-fetch-happen", { | ||
cache: "no-cache" // forces a conditional request | ||
}); | ||
}).then(function (res) { | ||
console.log(res.status); // 304! cache validated! | ||
return res.json().then(function (body) { | ||
console.log("got ".concat(body.name, " from cache")); | ||
}); | ||
}); |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
3b0eaae3cf522f845dd9aa5e37390df38ec8323a {"key":"make-fetch-happen:request-cache:https://registry.npmjs.org/make-fetch-happen","integrity":"sha512-Ae0r/UtLMuneVYy8RDxlSmeXE7Wc6oL+lhPGOXesxroE8zRRBI56tMemTId07tBMhKB5NiYg4TVmbr9Nm6F/bw==","time":1714585969568,"size":378846,"metadata":{"time":1714585969521,"url":"https://registry.npmjs.org/make-fetch-happen","reqHeaders":{},"resHeaders":{"cache-control":"public, max-age=300","content-encoding":"gzip","content-type":"application/json","date":"Wed, 01 May 2024 17:52:49 GMT","etag":"W/\"dc823f06e80566070423f16582d8ad59\"","last-modified":"Tue, 30 Apr 2024 14:54:41 GMT","vary":"accept-encoding, accept"},"options":{"compress":true}}} | ||
0bc1b833ce966d65b2b571e95e7ddc815740e34d {"key":"make-fetch-happen:request-cache:https://registry.npmjs.org/make-fetch-happen","integrity":"sha512-Ae0r/UtLMuneVYy8RDxlSmeXE7Wc6oL+lhPGOXesxroE8zRRBI56tMemTId07tBMhKB5NiYg4TVmbr9Nm6F/bw==","time":1714585969616,"size":378846,"metadata":{"time":1714585969615,"url":"https://registry.npmjs.org/make-fetch-happen","reqHeaders":{},"resHeaders":{"cache-control":"public, max-age=300","date":"Wed, 01 May 2024 17:52:49 GMT","etag":"\"dc823f06e80566070423f16582d8ad59\"","last-modified":"Tue, 30 Apr 2024 14:54:41 GMT","vary":"Accept-Encoding","content-encoding":"gzip","content-type":"application/json"},"options":{"compress":true}}} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.