@cacheable/node-cache 1.1.0 → 1.2.1

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/README.md CHANGED
@@ -79,13 +79,15 @@ When initializing the cache you can pass in the options below:
79
79
 
80
80
  ```javascript
81
81
  export type NodeCacheStoreOptions = {
82
- ttl?: number; // The standard ttl as number in seconds for every generated cache element. 0 = unlimited
82
+ ttl?: number; // The standard ttl as number in milliseconds for every generated cache element. 0 = unlimited
83
83
  primary?: Keyv; // The primary storage adapter
84
84
  secondary?: Keyv; // The secondary storage adapter
85
85
  maxKeys?: number; // Default is 0 (unlimited). If this is set it will throw and error if you try to set more keys than the max.
86
86
  };
87
87
  ```
88
88
 
89
+ Note: the `ttl` is now in milliseconds and not seconds like `stdTTL` in `NodeCache`.
90
+
89
91
  ### Node Cache Store API
90
92
 
91
93
  * `set(key: string | number, value: any, ttl?: number): Promise<boolean>` - Set a key value pair with an optional ttl (in milliseconds). Will return true on success. If the ttl is not set it will default to 0 (no ttl)
package/dist/index.cjs CHANGED
@@ -92,7 +92,6 @@ var NodeCacheStore = class {
92
92
  }
93
93
  async set(key, value, ttl) {
94
94
  if (this._maxKeys > 0) {
95
- console.log(this._cache.stats.count, this._maxKeys);
96
95
  if (this._cache.stats.count >= this._maxKeys) {
97
96
  return false;
98
97
  }
package/dist/index.js CHANGED
@@ -56,7 +56,6 @@ var NodeCacheStore = class {
56
56
  }
57
57
  async set(key, value, ttl) {
58
58
  if (this._maxKeys > 0) {
59
- console.log(this._cache.stats.count, this._maxKeys);
60
59
  if (this._cache.stats.count >= this._maxKeys) {
61
60
  return false;
62
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cacheable/node-cache",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Simple and Maintained fast NodeJS internal caching",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -27,7 +27,7 @@
27
27
  "cacheable-node"
28
28
  ],
29
29
  "devDependencies": {
30
- "@types/node": "^22.5.5",
30
+ "@types/node": "^22.7.4",
31
31
  "@vitest/coverage-v8": "^2.1.1",
32
32
  "rimraf": "^6.0.1",
33
33
  "tsup": "^8.3.0",
@@ -36,9 +36,9 @@
36
36
  "xo": "^0.59.3"
37
37
  },
38
38
  "dependencies": {
39
- "cacheable": "^1.2.0",
39
+ "cacheable": "^1.6.0",
40
40
  "eventemitter3": "^5.0.1",
41
- "keyv": "^5.0.1"
41
+ "keyv": "^5.0.3"
42
42
  },
43
43
  "files": [
44
44
  "dist",