Socket
Socket
Sign inDemoInstall

catbox-redis

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

catbox-redis - npm Package Compare versions

Comparing version 2.0.2 to 3.0.0

2

CONTRIBUTING.md

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

Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/.github/CONTRIBUTING.md).

@@ -6,3 +6,3 @@

const Redis = require('redis');
const Redis = require('ioredis');
const Hoek = require('hoek');

@@ -26,3 +26,3 @@

this.settings = Hoek.applyToDefaults(internals.defaults, options);
this.settings = Object.assign({}, internals.defaults, options);
this.client = options.client || null;

@@ -44,17 +44,14 @@ return this;

const options = {
password: this.settings.password,
db: this.settings.database || this.settings.db
};
if (this.settings.socket) {
client = Redis.createClient(this.settings.socket);
client = Redis.createClient(this.settings.socket, options);
}
else {
client = Redis.createClient(this.settings.port, this.settings.host);
client = Redis.createClient(this.settings.port, this.settings.host, options);
}
if (this.settings.password) {
client.auth(this.settings.password);
}
if (this.settings.database) {
client.select(this.settings.database);
}
// Listen to errors

@@ -92,3 +89,3 @@

return !!this.client && this.client.connected;
return !!this.client;
};

@@ -159,3 +156,3 @@

stored: Date.now(),
ttl: ttl
ttl
};

@@ -162,0 +159,0 @@

{
"name": "catbox-redis",
"description": "Redis adapter for catbox",
"version": "2.0.2",
"version": "3.0.0",
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)",

@@ -20,9 +20,9 @@ "contributors": [

"dependencies": {
"redis": "2.x.x",
"hoek": "4.x.x"
"hoek": "4.x.x",
"ioredis": "2.x.x"
},
"devDependencies": {
"catbox": "7.x.x",
"code": "2.x.x",
"lab": "10.x.x"
"code": "4.x.x",
"lab": "13.x.x"
},

@@ -29,0 +29,0 @@ "scripts": {

@@ -10,3 +10,3 @@

const Redis = require('..');
const RedisClient = require('redis');
const RedisClient = require('ioredis');

@@ -96,3 +96,3 @@

it('gets an item after settig it', (done) => {
it('gets an item after setting it', (done) => {

@@ -496,10 +496,7 @@ const client = new Catbox.Client(Redis);

redis.start(() => {});
redis.start(() => {
// redis.client.selected_db gets updated after the callback
setTimeout(() => {
done();
expect(redis.client.selected_db).to.equal(1);
done();
}, 10);
});
});

@@ -520,4 +517,2 @@

expect(client).to.exist();
expect(client.connected).to.equal(true);
expect(client.address).to.equal(options.socket);
done();

@@ -591,25 +586,2 @@ });

});
it('returns false when disconnected', (done) => {
const options = {
host: '127.0.0.1',
port: 6379
};
const redis = new Redis(options);
redis.start((err) => {
expect(err).to.not.exist();
expect(redis.client).to.exist();
expect(redis.isReady()).to.equal(true);
redis.client.end();
expect(redis.isReady()).to.equal(false);
done();
});
});
});

@@ -616,0 +588,0 @@

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