@opuscapita/cache
Advanced tools
Comparing version 1.1.1 to 1.1.2
15
index.js
@@ -22,3 +22,6 @@ const extend = require('extend'); | ||
* @memberof module:@opuscapita/cache | ||
* @param {object} config - For a list of possible configuration values see [DefaultConfig]{@link module:@opuscapita/cache.DefaultConfig}. | ||
* @param {object} [config] - For a list of possible configuration values see [DefaultConfig]{@link module:@opuscapita/cache.DefaultConfig}. | ||
* @param {string} [config.driver] - Cache driver. | ||
* @param {object} [config.redis] - Redis configuration. | ||
* @param {object} [config.memory] - Redis configuration. | ||
* @constructor | ||
@@ -30,3 +33,3 @@ */ | ||
this.setKeyPrefix(config.keyPrefix || ''); | ||
this.setKeyPrefix(config.keyPrefix || ''); | ||
@@ -39,2 +42,4 @@ if(config.driver) | ||
this.use(new plugin(config[config.driver])); | ||
// other configuration is read from this.config | ||
// defaultExpire is used when creating a new entry (not passed to the cache plugin during initialization) | ||
} | ||
@@ -66,3 +71,3 @@ } | ||
* @param {object} value - Value to store. | ||
* @param {number} expires - Optional cache entry lifetime in seconds. | ||
* @param {number} [expires] - cache entry lifetime in seconds. | ||
* @returns {Promise} [Promise]{@link http://bluebirdjs.com/docs/api-reference.html}. | ||
@@ -82,3 +87,3 @@ */ | ||
* @param {object} value - Value to store. | ||
* @param {number} expires - Optional cache entry lifetime in seconds. | ||
* @param {?number} [expires] - cache entry lifetime in seconds. | ||
* @returns {Promise} [Promise]{@link http://bluebirdjs.com/docs/api-reference.html} containing false or a Promise object. | ||
@@ -120,3 +125,3 @@ */ | ||
* @param {string} key - Cache key. | ||
* @param {number} waitTimeout - Optioknal max timeout to wait before returning a value that does not exist in the cache. If no timeout is passed, this method will always return immediately. | ||
* @param {number} [waitTimeout] - Optional max timeout to wait before returning a value that does not exist in the cache. If no timeout is passed, this method will always return immediately. | ||
* @returns {Promise} [Promise]{@link http://bluebirdjs.com/docs/api-reference.html} value or undefined if the key did not exist. | ||
@@ -123,0 +128,0 @@ */ |
{ | ||
"name": "@opuscapita/cache", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "General cache abstraction layer.", | ||
@@ -8,9 +8,6 @@ "main": "index.js", | ||
"start": "npm run test", | ||
"test": "sleep 10 ; npm run setup-consul ; npx nyc mocha --exit --timeout 20000 -R mocha-junit-reporter", | ||
"test-raw": "npm run setup-consul ; npx nyc mocha --exit --timeout 20000", | ||
"test-coverage": "sleep 10 ; npm run setup-consul ; npx nyc --reporter=lcov mocha --timeout 20000 && sed -i 's/\\/home\\/node\\/cache\\//\\.\\//g' coverage/lcov.info", | ||
"upload-coverage": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", | ||
"setup-consul": "curl -X PUT -d 'test123' http://${HOST_IP}:8500/v1/kv/cache/redis/password", | ||
"clean": "npx rimraf .nyc_output coverage test-results.xml", | ||
"docs": "npx jsdoc2md index.js > wiki/Home.md" | ||
"dev": "npm run setup-consul ; npx nyc -r lcov mocha -w --recursive --reporter=spec", | ||
"test": "npm run setup-consul ; npm install -D mocha-junit-reporter ; npx nyc -r lcov mocha --exit --timeout 20000 -R mocha-junit-reporter -O mochaFile=./junit/test-results.xml", | ||
"setup-consul": "sh setup-consul.sh", | ||
"clean": "npx rimraf .nyc_output coverage test-results.xml" | ||
}, | ||
@@ -37,13 +34,14 @@ "repository": { | ||
"@opuscapita/config": "^3.1.0", | ||
"@opuscapita/logger": "^1.1.0", | ||
"bluebird": "^3.5.1", | ||
"extend": "^3.0.1", | ||
"node-cache": "^4.2.0", | ||
"node-cache": "^4.2.1", | ||
"redis": "^2.8.0" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^3.0.1", | ||
"@types/chai": "^4.3.1", | ||
"@types/mocha": "^9.1.1", | ||
"@types/node": "^17.0.31", | ||
"jsdoc-to-markdown": "^3.0.4", | ||
"mocha": "^5.2.0", | ||
"mocha-junit-reporter": "^1.17.0", | ||
"mocha-junit-reporter": "^1.23.3", | ||
"nyc": "^13.0.0", | ||
@@ -50,0 +48,0 @@ "rimraf": "^2.6.1" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14929
5
314
8
1
- Removed@opuscapita/logger@^1.1.0
- Removed@opuscapita/logger@1.9.5(transitive)
- Removedcorrelation-id@4.0.0(transitive)
- Removedmocha-lcov-reporter@1.3.0(transitive)
- Removeduuid@8.3.2(transitive)
Updatednode-cache@^4.2.1