Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sessionstore

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sessionstore - npm Package Compare versions

Comparing version 0.4.6 to 0.4.7

44

lib/databases/redis.js

@@ -21,2 +21,20 @@ var util = require(process.binding('natives').util ? 'util' : 'sys'),

if (options.url) {
var url = require('url').parse(options.url);
if (url.protocol === 'redis:') {
if (url.auth) {
var userparts = url.auth.split(":");
options.user = userparts[0];
if (userparts.length === 2) {
options.password = userparts[1];
}
}
options.host = url.hostname;
options.port = url.port;
if (url.pathname) {
options.db = url.pathname.replace("/", "", 1);
}
}
}
this.client = new redis.createClient(options.port || options.socket, options.host, options);

@@ -28,13 +46,19 @@

var calledBack = false;
if (options.password) {
this.client.auth(options.password, function(err) {
if (err && !calledBack && callback) {
calledBack = true;
if (callback) callback(err, self);
return;
}
if (err) throw err;
});
}
if (options.db) {
this.client.select(options.db);
this.client.on("connect", function () {
self.client.send_anyways = true;
self.client.select(options.db);
self.client.send_anyways = false;
});
}
var calledBack = false;
this.client.on('error', function () {

@@ -49,2 +73,8 @@ self.emit('disconnect');

this.client.on('connect', function () {
if (options.db) {
self.client.send_anyways = true;
self.client.select(options.db);
self.client.send_anyways = false;
}
self.emit('connect');

@@ -51,0 +81,0 @@

2

package.json
{
"author": "adrai",
"name": "sessionstore",
"version": "0.4.6",
"version": "0.4.7",
"private": false,

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

# Introduction
[![Build Status](https://secure.travis-ci.org/adrai/sessionstore.svg)](http://travis-ci.org/adrai/sessionstore)
[![travis](https://img.shields.io/travis/adrai/sessionstore.svg)](https://travis-ci.org/adrai/sessionstore) [![npm](https://img.shields.io/npm/v/sessionstore.svg)](https://npmjs.org/package/sessionstore)

@@ -162,2 +162,2 @@ Sessionstore is a node.js module for multiple databases. It can be very useful if you work with express or connect.

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
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