@cacheable/node-cache 1.6.0 → 1.7.0

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/dist/index.cjs CHANGED
@@ -31,11 +31,13 @@ var import_hookified2 = require("hookified");
31
31
 
32
32
  // src/store.ts
33
33
  var import_cacheable = require("cacheable");
34
- var import_keyv = require("keyv");
35
34
  var import_hookified = require("hookified");
35
+ var import_keyv = require("keyv");
36
36
  var NodeCacheStore = class extends import_hookified.Hookified {
37
37
  _maxKeys = 0;
38
- _cache = new import_cacheable.Cacheable({ primary: new import_keyv.Keyv({ store: new import_cacheable.CacheableMemory() }) });
38
+ _cache = new import_cacheable.Cacheable({
39
+ primary: new import_keyv.Keyv({ store: new import_cacheable.CacheableMemory() })
40
+ });
39
41
  constructor(options) {
40
42
  super();
41
43
  if (options) {
@@ -150,9 +152,13 @@ var NodeCacheStore = class extends import_hookified.Hookified {
150
152
  * @returns {void}
151
153
  */
152
154
  async mset(list) {
153
- const items = new Array();
155
+ const items = [];
154
156
  for (const item of list) {
155
- items.push({ key: item.key.toString(), value: item.value, ttl: item.ttl });
157
+ items.push({
158
+ key: item.key.toString(),
159
+ value: item.value,
160
+ ttl: item.ttl
161
+ });
156
162
  }
157
163
  await this._cache.setMany(items);
158
164
  }
@@ -239,7 +245,6 @@ var NodeCacheErrors = /* @__PURE__ */ ((NodeCacheErrors2) => {
239
245
  })(NodeCacheErrors || {});
240
246
  var NodeCache = class extends import_hookified2.Hookified {
241
247
  options = {
242
- // eslint-disable-next-line @typescript-eslint/naming-convention
243
248
  stdTTL: 0,
244
249
  checkperiod: 600,
245
250
  useClones: true,
@@ -289,7 +294,11 @@ var NodeCache = class extends import_hookified2.Hookified {
289
294
  throw this.createError("Cache max keys amount exceeded" /* ECACHEFULL */, this.formatKey(key));
290
295
  }
291
296
  }
292
- this.store.set(keyValue, { key: keyValue, value, ttl: expirationTimestamp });
297
+ this.store.set(keyValue, {
298
+ key: keyValue,
299
+ value,
300
+ ttl: expirationTimestamp
301
+ });
293
302
  this.emit("set", keyValue, value, ttlValue);
294
303
  this._stats.incrementKSize(keyValue);
295
304
  this._stats.incrementVSize(value);
package/dist/index.js CHANGED
@@ -4,11 +4,13 @@ import { Hookified as Hookified2 } from "hookified";
4
4
 
5
5
  // src/store.ts
6
6
  import { Cacheable, CacheableMemory } from "cacheable";
7
- import { Keyv } from "keyv";
8
7
  import { Hookified } from "hookified";
8
+ import { Keyv } from "keyv";
9
9
  var NodeCacheStore = class extends Hookified {
10
10
  _maxKeys = 0;
11
- _cache = new Cacheable({ primary: new Keyv({ store: new CacheableMemory() }) });
11
+ _cache = new Cacheable({
12
+ primary: new Keyv({ store: new CacheableMemory() })
13
+ });
12
14
  constructor(options) {
13
15
  super();
14
16
  if (options) {
@@ -123,9 +125,13 @@ var NodeCacheStore = class extends Hookified {
123
125
  * @returns {void}
124
126
  */
125
127
  async mset(list) {
126
- const items = new Array();
128
+ const items = [];
127
129
  for (const item of list) {
128
- items.push({ key: item.key.toString(), value: item.value, ttl: item.ttl });
130
+ items.push({
131
+ key: item.key.toString(),
132
+ value: item.value,
133
+ ttl: item.ttl
134
+ });
129
135
  }
130
136
  await this._cache.setMany(items);
131
137
  }
@@ -212,7 +218,6 @@ var NodeCacheErrors = /* @__PURE__ */ ((NodeCacheErrors2) => {
212
218
  })(NodeCacheErrors || {});
213
219
  var NodeCache = class extends Hookified2 {
214
220
  options = {
215
- // eslint-disable-next-line @typescript-eslint/naming-convention
216
221
  stdTTL: 0,
217
222
  checkperiod: 600,
218
223
  useClones: true,
@@ -262,7 +267,11 @@ var NodeCache = class extends Hookified2 {
262
267
  throw this.createError("Cache max keys amount exceeded" /* ECACHEFULL */, this.formatKey(key));
263
268
  }
264
269
  }
265
- this.store.set(keyValue, { key: keyValue, value, ttl: expirationTimestamp });
270
+ this.store.set(keyValue, {
271
+ key: keyValue,
272
+ value,
273
+ ttl: expirationTimestamp
274
+ });
266
275
  this.emit("set", keyValue, value, ttlValue);
267
276
  this._stats.incrementKSize(keyValue);
268
277
  this._stats.incrementVSize(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cacheable/node-cache",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Simple and Maintained fast NodeJS internal caching",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -12,6 +12,9 @@
12
12
  "import": "./dist/index.js"
13
13
  }
14
14
  },
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
15
18
  "repository": {
16
19
  "type": "git",
17
20
  "url": "git+https://github.com/jaredwray/cacheable.git",
@@ -31,19 +34,18 @@
31
34
  "cacheable-node"
32
35
  ],
33
36
  "devDependencies": {
34
- "@types/eslint": "^9.6.1",
35
- "@types/node": "^24.0.7",
37
+ "@biomejs/biome": "^2.2.0",
38
+ "@types/node": "^24.3.0",
36
39
  "@vitest/coverage-v8": "^3.2.4",
37
40
  "rimraf": "^6.0.1",
38
41
  "tsup": "^8.5.0",
39
- "typescript": "^5.8.3",
40
- "vitest": "^3.2.4",
41
- "xo": "^1.1.1"
42
+ "typescript": "^5.9.2",
43
+ "vitest": "^3.2.4"
42
44
  },
43
45
  "dependencies": {
44
- "hookified": "^1.10.0",
45
- "keyv": "^5.3.4",
46
- "cacheable": "^1.10.1"
46
+ "hookified": "^1.11.0",
47
+ "keyv": "^5.5.0",
48
+ "cacheable": "^1.10.4"
47
49
  },
48
50
  "files": [
49
51
  "dist",
@@ -52,8 +54,8 @@
52
54
  "scripts": {
53
55
  "build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
54
56
  "prepublish": "pnpm build",
55
- "test": "xo --fix && vitest run --coverage",
56
- "test:ci": "xo && vitest run --coverage",
57
+ "test": "biome check --write && vitest run --coverage",
58
+ "test:ci": "biome check && vitest run --coverage",
57
59
  "clean": "rimraf ./dist ./coverage ./node_modules"
58
60
  }
59
61
  }