cache-manager
Advanced tools
Comparing version 2.0.1 to 2.1.1
@@ -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 |
@@ -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 @@ |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133609
2844
308