connect-redis
Advanced tools
Comparing version 3.4.0 to 3.4.1
@@ -0,1 +1,6 @@ | ||
# 3.4.1 / 2018-09-28 | ||
- Update debug dependency | ||
- Do not require node_redis dependency | ||
# 3.4.0 / 2018-09-28 | ||
@@ -2,0 +7,0 @@ |
@@ -8,3 +8,2 @@ /*! | ||
var debug = require('debug')('connect:redis'); | ||
var redis = require('redis'); | ||
var util = require('util'); | ||
@@ -80,9 +79,12 @@ var noop = function(){}; | ||
this.client = options.client; | ||
} else { | ||
var redis = require('redis'); | ||
if (options.socket) { | ||
this.client = redis.createClient(options.socket, options); | ||
} | ||
else { | ||
this.client = redis.createClient(options); | ||
} | ||
} | ||
else if (options.socket) { | ||
this.client = redis.createClient(options.socket, options); | ||
} | ||
else { | ||
this.client = redis.createClient(options); | ||
} | ||
@@ -316,3 +318,21 @@ // logErrors | ||
/** | ||
* Fetch count of all sessions | ||
* | ||
* @param {Function} fn | ||
* @api public | ||
*/ | ||
RedisStore.prototype.length = function (fn) { | ||
var store = this; | ||
if (!fn) fn = noop; | ||
allKeys(store, function (err, keys) { | ||
if (err) return fn(err); | ||
return fn(null, keys.length); | ||
}); | ||
}; | ||
/** | ||
@@ -319,0 +339,0 @@ * Fetch all sessions |
{ | ||
"name": "connect-redis", | ||
"description": "Redis session store for Connect", | ||
"version": "3.4.0", | ||
"version": "3.4.1", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -16,3 +16,3 @@ "contributors": [ | ||
"dependencies": { | ||
"debug": "^4.0.1", | ||
"debug": "^4.1.1", | ||
"redis": "^2.8.0" | ||
@@ -19,0 +19,0 @@ }, |
@@ -61,2 +61,6 @@ [![npm](https://img.shields.io/npm/v/connect-redis.svg)](https://npmjs.com/package/connect-redis) [![Dependencies](https://img.shields.io/david/tj/connect-redis.svg)](https://david-dm.org/tj/connect-redis) ![Downloads](https://img.shields.io/npm/dm/connect-redis.svg) | ||
#### Testing / Development | ||
You can use [redis-mock](https://github.com/yeahoffline/redis-mock) as the client instead of connecting to an actual redis server for automated testing and development purposes. | ||
FAQ | ||
@@ -63,0 +67,0 @@ --- |
@@ -29,2 +29,5 @@ /* eslint-env es6 */ | ||
data = yield store.lengthAsync(); | ||
t.deepEqual(1, data, '#length() ok'); | ||
ok = yield store.destroyAsync('123'); | ||
@@ -31,0 +34,0 @@ t.equal(ok, 1, '#destroy() ok'); |
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
24440
501
88
Updateddebug@^4.1.1