fetch-json-cache 0.1.8 → 0.1.11

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/get.js CHANGED
@@ -19,7 +19,10 @@ module.exports = function getCache(endpoint, callback) {
19
19
  var record = JSON.parse(contents.toString());
20
20
  get(endpoint).head(function (err, res) {
21
21
  // not accessible
22
- if (err) return err.code === 'ENOTFOUND' ? callback(null, record.body) : callback(err);
22
+ if (err) {
23
+ if (err.code === 'ENOTFOUND' || err.message.indexOf('routines:SSL23_GET_SERVER_HELLO') >= 0) return callback(null, record.body);
24
+ return callback(err);
25
+ }
23
26
  if (res.headers.etag === record.headers.etag) return callback(null, record.body);
24
27
  update.call(self, endpoint, function (err, json) {
25
28
  err ? callback(err) : callback(null, json);
@@ -1,8 +1,8 @@
1
1
  var rimraf = require('rimraf');
2
2
 
3
- var get = require('./lib/get');
4
- var hash = require('./lib/hash');
5
- var update = require('./lib/update');
3
+ var get = require('./get');
4
+ var hash = require('./hash');
5
+ var update = require('./update');
6
6
 
7
7
  function Cache(cacheDirectory, options) {
8
8
  if (!(this instanceof Cache)) return new Cache(cacheDirectory, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fetch-json-cache",
3
- "version": "0.1.8",
3
+ "version": "0.1.11",
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",
@@ -15,35 +15,37 @@
15
15
  },
16
16
  "license": "MIT",
17
17
  "author": "Kevin Malakoff <kmalakoff@gmail.com> (https://github.com/kmalakoff)",
18
- "main": "index.js",
18
+ "main": "lib/index.js",
19
+ "files": [
20
+ "lib"
21
+ ],
19
22
  "scripts": {
20
23
  "format": "prettier --write .",
21
24
  "lint": "eslint .",
22
25
  "prepublishOnly": "dtd \"npm run lint\" \"depcheck\"",
23
- "test": "mocha-compat test/spec/**/*.test.js"
26
+ "test": "mocha-compat test/spec/**/*.test.js --no-timeouts"
24
27
  },
25
28
  "dependencies": {
26
- "get-remote": "^0.6.0",
29
+ "get-remote": "^0.6.3",
27
30
  "mkpath": "^1.0.0",
28
31
  "rimraf": "^2.7.1",
29
32
  "write-file-atomic": "^1.3.4"
30
33
  },
31
34
  "devDependencies": {
32
- "babel-eslint": "^10.1.0",
33
- "depcheck": "^1.4.2",
34
- "dis-dat": "^0.1.3",
35
- "eslint": "^6.8.0",
36
- "eslint-config-prettier": "^6.11.0",
37
- "eslint-config-standard": "^14.1.1",
38
- "eslint-plugin-import": "^2.22.0",
39
- "eslint-plugin-node": "^11.1.0",
40
- "eslint-plugin-promise": "^4.2.1",
41
- "eslint-plugin-standard": "^4.0.1",
35
+ "@typescript-eslint/parser": "^5.30.0",
36
+ "depcheck": "^1.4.3",
37
+ "dis-dat": "^0.1.6",
38
+ "eslint": "^8.18.0",
39
+ "eslint-config-prettier": "^8.5.0",
40
+ "eslint-config-standard": "^17.0.0",
41
+ "eslint-plugin-import": "^2.26.0",
42
+ "eslint-plugin-n": "^15.2.3",
43
+ "eslint-plugin-promise": "^6.0.0",
42
44
  "fs-access-sync-compat": "^1.0.1",
43
45
  "mocha-compat": "^3.5.5",
44
- "prettier": "^2.3.2"
46
+ "prettier": "^2.7.1"
45
47
  },
46
48
  "engines": {
47
- "node": ">=0.8.0"
49
+ "node": ">=0.8"
48
50
  }
49
51
  }