Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cache-manager

Package Overview
Dependencies
Maintainers
1
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cache-manager - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

4

History.md

@@ -0,1 +1,5 @@

- 2.3.0 2016-12-22
- Updating isCacheableValue description in README; README syntax error fix (#70, #71) - @lukechilds
- Calling back with null as first argument in memory store to keep style consistent (#72) - @defcc
- 2.2.0 2016-10-19

@@ -2,0 +6,0 @@ - Adding multi_caching.reset() (#63) - @disjunction

14

lib/stores/memory.js

@@ -32,3 +32,3 @@ var Lru = require("lru-cache");

if (cb) {
process.nextTick(cb);
process.nextTick(cb.bind(null, null));
} else if (self.usePromises) {

@@ -46,5 +46,3 @@ return Promise.resolve(value);

if (cb) {
process.nextTick(function() {
cb(null, value);
});
process.nextTick(cb.bind(null, null, value));
} else if (self.usePromises) {

@@ -65,3 +63,3 @@ return Promise.resolve(value);

if (cb) {
process.nextTick(cb);
process.nextTick(cb.bind(null, null));
} else if (self.usePromises) {

@@ -75,3 +73,3 @@ return Promise.resolve();

if (cb) {
process.nextTick(cb);
process.nextTick(cb.bind(null, null));
} else if (self.usePromises) {

@@ -85,5 +83,3 @@ return Promise.resolve();

if (cb) {
process.nextTick(function() {
cb(null, keys);
});
process.nextTick(cb.bind(null, null, keys));
} else if (self.usePromises) {

@@ -90,0 +86,0 @@ return Promise.resolve(keys);

{
"name": "cache-manager",
"version": "2.2.0",
"version": "2.3.0",
"description": "Cache module for Node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,3 +0,3 @@

[![build status](https://secure.travis-ci.org/BryanDonovan/node-cache-manager.png)](http://travis-ci.org/BryanDonovan/node-cache-manager)
[![Coverage Status](https://coveralls.io/repos/BryanDonovan/node-cache-manager/badge.png?branch=master)](https://coveralls.io/r/BryanDonovan/node-cache-manager?branch=master)
[![build status](https://secure.travis-ci.org/BryanDonovan/node-cache-manager.svg)](http://travis-ci.org/BryanDonovan/node-cache-manager)
[![Coverage Status](https://coveralls.io/repos/BryanDonovan/node-cache-manager/badge.svg?branch=master)](https://coveralls.io/r/BryanDonovan/node-cache-manager?branch=master)

@@ -253,9 +253,11 @@ node-cache-manager

### Specifying What to Cache
### Specifying What to Cache in `wrap` Function
Both the `caching` and `multicaching` modules allow you to pass in a callback function named
`isCacheableValue` which is called with every value returned from cache or from a wrapped function.
This lets you specify which values should and should not be cached. If the function returns true, it will be
`isCacheableValue` which is called by the `wrap` function with every value returned from cache or from the wrapped function.
This lets you specify which values should and should not be cached by `wrap`. If the function returns true, it will be
stored in cache. By default the caches cache everything except `undefined`.
NOTE: The `set` functions in `caching` and `multicaching` do *not* use `isCacheableValue`.
For example, if you don't want to cache `false` and `null`, you can pass in a function like this:

@@ -275,3 +277,3 @@

var memoryCache = cacheManager.caching({store: 'memory', isCacheableValue: isCacheableValue};
var memoryCache = cacheManager.caching({store: 'memory', isCacheableValue: isCacheableValue});

@@ -278,0 +280,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc