🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

cache-manager

Package Overview
Dependencies
Maintainers
1
Versions
120
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

to
0.3.0

4

History.md

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

- 0.3.0 2013-12-08
Bound the get, set and del functions to their original “this” context when assigning a store.
(Thanks to Boyan Rabchev)
- 0.2.0 2013-10-31

@@ -2,0 +6,0 @@ Better examples, version bump.

6

lib/caching.js

@@ -51,7 +51,7 @@ var caching = function (args) {

self.get = self.store.get;
self.get = self.store.get.bind(self.store);
self.set = self.store.set;
self.set = self.store.set.bind(self.store);
self.del = self.store.del;
self.del = self.store.del.bind(self.store);

@@ -58,0 +58,0 @@ return self;

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

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

@@ -30,3 +30,3 @@ [![build status](https://secure.travis-ci.org/BryanDonovan/node-cache-manager.png)](http://travis-ci.org/BryanDonovan/node-cache-manager)

(Note, this was inspired by [node-caching](https://github.com/mape/node-caching).)
This is probably the feature you're looking for. As an example, where you might have to do this
This is probably the feature you're looking for. As an example, where you might have to do this:

@@ -58,12 +58,2 @@ ```javascript

}
get_cached_user(user_id, function (err, user) {
// First time fetches the user from the (fake) database:
console.log(user);
get_cached_user(user_id, function (err, user) {
// Second time fetches from cache.
console.log(user);
});
});
```

@@ -70,0 +60,0 @@