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 1.3.0 to 1.4.0

3

History.md

@@ -0,1 +1,4 @@

- 1.4.0 2016-02-03
- Passing ttl of 0 to lruCache, upgrading to lru-cache 4.0.0
- 1.3.0 2016-01-26

@@ -2,0 +5,0 @@ - Promise support (#39, #24) - @PuKoren

2

lib/stores/memory.js

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

max: args.max || 500,
maxAge: ttl ? ttl * 1000 : null,
maxAge: (ttl || ttl === 0) ? ttl * 1000 : null,
dispose: args.dispose,

@@ -13,0 +13,0 @@ length: args.length,

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

@@ -24,3 +24,3 @@ "main": "index.js",

"async": "^0.9.0",
"lru-cache": "2.6.5"
"lru-cache": "4.0.0"
},

@@ -27,0 +27,0 @@ "devDependencies": {

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

set(key, val, ttl, cb)
set(key, val, {ttl: ttl}, cb) // * see note below
get(key, cb)
del(key, cb)
// * Note that depending on the underlying store, you may be able to pass the
// ttl as the third param, like this:
set(key, val, ttl, cb)
// ... or pass no ttl at all:
set(key, val, cb)
Third, node-cache-manager lets you set up a tiered cache strategy. This may be of

@@ -147,4 +153,4 @@ limited use in most cases, but imagine a scenario where you expect tons of

return getUserPromise(userId);
});
then(function(user) {
})
.then(function(user) {
console.log('User:', user);

@@ -151,0 +157,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