Comparing version 0.2.1 to 0.3.0
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
var redis = require("redis"); | ||
@@ -8,7 +10,9 @@ | ||
var Client = function(options) { | ||
this.host = options.host || "127.0.0.1"; | ||
this.port = options.port || 6379; | ||
this.redisClient = redis.createClient(this.port, this.host, { | ||
no_ready_check: true | ||
}); | ||
// Can pass in redisClient directly, or we create our own | ||
// using options.host/options.port with defaults. | ||
this.redisClient = options.redisClient || redis.createClient( | ||
options.port || 6379, | ||
options.host || "127.0.0.1", | ||
{no_ready_check: true} | ||
); | ||
@@ -53,10 +57,16 @@ return this; | ||
Client.prototype.removeAccount = function(token, cb) { | ||
this.redisClient.del(token, cb); | ||
}; | ||
// Module object | ||
var authdb = { | ||
createClient: function(options) { | ||
return new Client(options); | ||
} | ||
var authdb = function (options) { | ||
// Don't fail on missing options. | ||
return new Client(options || {}); | ||
}; | ||
// Backwrads compatible. | ||
authdb.createClient = authdb; | ||
// Export the module object. | ||
module.exports = authdb; |
{ | ||
"name": "authdb", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "database of authenticated users", | ||
@@ -9,4 +9,4 @@ "main": "authdb.js", | ||
"dependencies": { | ||
"redis": "~0.12.1" | ||
"redis": "^2.6.2" | ||
} | ||
} |
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
2478
61
+ Addeddouble-ended-queue@2.1.0-0(transitive)
+ Addedredis@2.8.0(transitive)
+ Addedredis-commands@1.7.0(transitive)
+ Addedredis-parser@2.6.0(transitive)
- Removedredis@0.12.1(transitive)
Updatedredis@^2.6.2