cache-manager 3.4.4 → 3.6.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/History.md CHANGED
@@ -1,3 +1,12 @@
1
+ - 3.6.1 2022-04-07
2
+ - Fix for potential prototype polution exploit in async < 3.2.2 (#186). - @tmbobbins
3
+
4
+ - 3.6.0 2021-11-12
5
+ - Added keyCount() method to memory store (#173). - @css-master
6
+
7
+ - 3.5.0 2021-11-11
8
+ - Added dump() and load() methods to memory store (#171). - @jeoy
9
+
1
10
  - 3.4.4 2021-06-11
2
11
  - vulnerability fix in package-lock.json.
3
12
 
package/README.md CHANGED
@@ -49,6 +49,8 @@ See the [Express.js cache-manager example app](https://github.com/BryanDonovan/n
49
49
 
50
50
  * [node-cache-manager-memory-store](https://github.com/theogravity/node-cache-manager-memory-store)
51
51
 
52
+ * [node-cache-manager-couchbase](https://github.com/davidepellegatta/node-cache-manager-couchbase)
53
+
52
54
  ## Overview
53
55
 
54
56
  **First**, it includes a `wrap` function that lets you wrap any function in cache.
@@ -186,6 +186,47 @@ var memoryStore = function(args) {
186
186
  }
187
187
  };
188
188
 
189
+ /**
190
+ * This method is not available in the caching modules.
191
+ */
192
+ self.keyCount = function() {
193
+ return lruCache.length;
194
+ };
195
+
196
+ /**
197
+ * This method is not available in the caching modules.
198
+ */
199
+ self.dump = function() {
200
+ var args = Array.prototype.slice.apply(arguments);
201
+ var cb;
202
+
203
+ if (typeof args[args.length - 1] === 'function') {
204
+ cb = args.pop();
205
+ }
206
+ var value = lruCache.dump();
207
+
208
+ if (cb) {
209
+ process.nextTick(cb.bind(null, null, value));
210
+ } else if (self.usePromises) {
211
+ return Promise.resolve(value);
212
+ } else {
213
+ return value;
214
+ }
215
+ };
216
+
217
+ /**
218
+ * This method is not available in the caching modules.
219
+ */
220
+ self.load = function(cacheEntries, cb) {
221
+ lruCache.load(cacheEntries);
222
+
223
+ if (typeof cb === 'function') {
224
+ process.nextTick(cb.bind(null, null));
225
+ } else if (self.usePromises) {
226
+ return Promise.resolve();
227
+ }
228
+ };
229
+
189
230
  return self;
190
231
  };
191
232
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cache-manager",
3
- "version": "3.4.4",
3
+ "version": "3.6.1",
4
4
  "description": "Cache module for Node.js",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -25,7 +25,7 @@
25
25
  "author": "Bryan Donovan",
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
- "async": "3.2.0",
28
+ "async": "3.2.3",
29
29
  "lodash": "^4.17.21",
30
30
  "lru-cache": "6.0.0"
31
31
  },
@@ -39,4 +39,4 @@
39
39
  "optimist": "0.6.1",
40
40
  "sinon": "9.0.3"
41
41
  }
42
- }
42
+ }