fetch-json-cache 0.1.12 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{getAsync.js → getSync.js} +0 -0
- package/lib/index.js +4 -3
- package/lib/polyfills.js +1 -0
- package/package.json +9 -8
|
File without changes
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
require('./polyfills')
|
|
1
2
|
var rimraf = require('rimraf');
|
|
2
3
|
|
|
3
4
|
var get = require('./get');
|
|
4
|
-
var
|
|
5
|
+
var getSync = require('./getSync');
|
|
5
6
|
var hash = require('./hash');
|
|
6
7
|
var update = require('./update');
|
|
7
8
|
|
|
@@ -29,9 +30,9 @@ Cache.prototype.get = function (endpoint, options, callback) {
|
|
|
29
30
|
});
|
|
30
31
|
};
|
|
31
32
|
|
|
32
|
-
Cache.prototype.
|
|
33
|
+
Cache.prototype.getSync = function (endpoint, options) {
|
|
33
34
|
// TODO: add async fetching
|
|
34
|
-
return
|
|
35
|
+
return getSync.call(this, endpoint);
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
Cache.prototype.clear = function (callback) {
|
package/lib/polyfills.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('es6-promise/auto');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fetch-json-cache",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Caches fetched json. Updates when etag changes and is uses cache regardless if endpoint unreachable. Uses write-file-atomic for safe updates",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"every",
|
|
@@ -22,24 +22,25 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"format": "prettier --write .",
|
|
24
24
|
"lint": "eslint .",
|
|
25
|
-
"prepublishOnly": "
|
|
26
|
-
"test": "mocha-compat test/spec/**/*.test.js --no-timeouts"
|
|
25
|
+
"prepublishOnly": "npm run lint && depcheck",
|
|
26
|
+
"test": "mocha-compat test/spec/**/*.test.js --no-timeouts",
|
|
27
|
+
"test:engines": "nvu engines npm test"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"
|
|
30
|
+
"es6-promise": "^4.2.8",
|
|
31
|
+
"get-remote": "^0.7.2",
|
|
30
32
|
"mkpath": "^1.0.0",
|
|
31
33
|
"rimraf": "^2.7.1",
|
|
32
34
|
"write-file-atomic": "^1.3.4"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
|
-
"@typescript-eslint/parser": "^5.30.
|
|
37
|
+
"@typescript-eslint/parser": "^5.30.7",
|
|
36
38
|
"depcheck": "^1.4.3",
|
|
37
|
-
"
|
|
38
|
-
"eslint": "^8.18.0",
|
|
39
|
+
"eslint": "^8.20.0",
|
|
39
40
|
"eslint-config-prettier": "^8.5.0",
|
|
40
41
|
"eslint-config-standard": "^17.0.0",
|
|
41
42
|
"eslint-plugin-import": "^2.26.0",
|
|
42
|
-
"eslint-plugin-n": "^15.2.
|
|
43
|
+
"eslint-plugin-n": "^15.2.4",
|
|
43
44
|
"eslint-plugin-promise": "^6.0.0",
|
|
44
45
|
"fs-access-sync-compat": "^1.0.1",
|
|
45
46
|
"mocha-compat": "^3.5.5",
|