@cacheable/node-cache
Advanced tools
Comparing version
@@ -161,3 +161,3 @@ import { Hookified } from 'hookified'; | ||
/** | ||
* Delete all expired items at the set interval. Default is true. | ||
* Delete expired items during an interval check or a single item on a get request. Default is true. | ||
*/ | ||
@@ -164,0 +164,0 @@ deleteOnExpire?: boolean; |
@@ -506,3 +506,6 @@ // src/index.ts | ||
if (value.ttl > 0 && value.ttl < Date.now()) { | ||
this.del(key); | ||
if (this.options.deleteOnExpire) { | ||
this.del(key); | ||
} | ||
this.emit("expired", this.formatKey(key), value.value); | ||
} | ||
@@ -509,0 +512,0 @@ } |
{ | ||
"name": "@cacheable/node-cache", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "Simple and Maintained fast NodeJS internal caching", | ||
@@ -34,14 +34,14 @@ "type": "module", | ||
"devDependencies": { | ||
"@types/node": "^22.10.2", | ||
"@vitest/coverage-v8": "^2.1.8", | ||
"@types/node": "^22.13.9", | ||
"@vitest/coverage-v8": "^3.0.7", | ||
"rimraf": "^6.0.1", | ||
"tsup": "^8.3.5", | ||
"typescript": "^5.7.2", | ||
"vitest": "^2.1.8", | ||
"tsup": "^8.4.0", | ||
"typescript": "^5.8.2", | ||
"vitest": "^3.0.7", | ||
"xo": "^0.60.0" | ||
}, | ||
"dependencies": { | ||
"hookified": "^1.6.0", | ||
"keyv": "^5.2.3", | ||
"cacheable": "^1.8.7" | ||
"hookified": "^1.7.1", | ||
"keyv": "^5.3.1", | ||
"cacheable": "^1.8.9" | ||
}, | ||
@@ -48,0 +48,0 @@ "files": [ |
@@ -144,3 +144,3 @@ [<img align="center" src="https://cacheable.org/symbol.svg" alt="Cacheable" />](https://github.com/jaredwray/cacheable) | ||
useClones?: boolean; // Default is true | ||
deleteOnExpire?: boolean; // Default is true, if this is set to true it will delete the key when it expires. | ||
deleteOnExpire?: boolean; // Default is true, if false it will keep the key and not delete during an interval check and the value on get() will be undefined | ||
maxKeys?: number; // Default is -1 (unlimited). If this is set it will throw and error if you try to set more keys than the max. | ||
@@ -147,0 +147,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
70800
0.51%1409
0.43%+ Added
- Removed
Updated
Updated
Updated