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.0.1 to 2.1.1

6

History.md

@@ -0,1 +1,7 @@

- 2.1.1 2016-05-24
- Fixing version number in package.json.
- 2.1.0 2016-05-24
- Allow passing in a promise dependency (#55). -@siddharthkchatterjee
- 2.0.1 2016-04-18

@@ -2,0 +8,0 @@ - Fixed triggering callback in wrap after it was queued (#48) - @theorm

2

lib/caching.js

@@ -32,2 +32,4 @@ /** @module cacheManager/caching */

var Promise = args.promiseDependency || global.Promise;
var callbackFiller = new CallbackFiller();

@@ -34,0 +36,0 @@

@@ -22,2 +22,4 @@ /** @module cacheManager/multiCaching */

var Promise = options.promiseDependency || global.Promise;
if (!Array.isArray(caches)) {

@@ -24,0 +26,0 @@ throw new Error('multiCaching requires an array of caches');

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

self.name = 'memory';
var Promise = args.promiseDependency || global.Promise;
self.usePromises = (typeof Promise === 'undefined' || args.noPromises) ? false : true;

@@ -9,0 +10,0 @@

2

package.json
{
"name": "cache-manager",
"version": "2.0.1",
"version": "2.1.1",
"description": "Cache module for Node.js",

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

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

* [node-cache-manager-mongoose](https://github.com/disjunction/node-cache-manager-mongoose)
* [node-cache-manager-fs](https://github.com/hotelde/node-cache-manager-fs)

@@ -159,2 +161,13 @@

If you are using a Node version that does not include native promises, you can
specify your promise dependency in the options passed to the cache module.
E.g.,
```javascript
var Promise = require('es6-promise').Promise;
cache = caching({store: store, promiseDependency: Promise});
```
#### Example Express App Usage

@@ -161,0 +174,0 @@

@@ -11,2 +11,4 @@ // TODO: These are really a mix of unit and integration tests.

var Promise = require('es6-promise').Promise;
var methods = {

@@ -31,3 +33,3 @@ getWidget: function(name, cb) {

beforeEach(function() {
cache = caching({store: store});
cache = caching({store: store, promiseDependency: Promise});
key = support.random.string(20);

@@ -34,0 +36,0 @@ value = support.random.string();

@@ -10,2 +10,4 @@ var assert = require('assert');

var Promise = require('es6-promise').Promise;
var methods = {

@@ -33,5 +35,5 @@ getWidget: function(name, cb) {

memoryCache = caching({store: 'memory', ttl: memoryTtl});
memoryCache2 = caching({store: 'memory', ttl: memoryTtl});
memoryCache3 = caching({store: 'memory', ttl: memoryTtl});
memoryCache = caching({store: 'memory', ttl: memoryTtl, promiseDependency: Promise});
memoryCache2 = caching({store: 'memory', ttl: memoryTtl, promiseDependency: Promise});
memoryCache3 = caching({store: 'memory', ttl: memoryTtl, promiseDependency: Promise});

@@ -38,0 +40,0 @@ key = support.random.string(20);

@@ -9,6 +9,2 @@ #!/usr/bin/env node

if (typeof Promise === "undefined") {
global.Promise = require('es6-promise').Promise;
}
var argv = optimist

@@ -15,0 +11,0 @@ .usage("Usage: $0 -t [types] --reporter [reporter] --timeout [timeout]")['default'](

Sorry, the diff of this file is not supported yet

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