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

@ladjs/redis

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ladjs/redis - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

12

index.js

@@ -38,4 +38,12 @@ const IORedis = require('ioredis');

function Redis(config = {}, logger = console, monitor = false) {
// eslint-disable-next-line max-params
function Redis(
config = {},
logger = console,
monitor = false,
maxListeners = 15,
_bindEvents = true
) {
const client = new IORedis(config);
client.setMaxListeners(maxListeners);
// https://github.com/luin/ioredis#monitor

@@ -63,3 +71,3 @@ if (monitor) {

bindEvents(client, logger);
if (_bindEvents) bindEvents(client, logger);
return client;

@@ -66,0 +74,0 @@ }

2

package.json
{
"name": "@ladjs/redis",
"description": "Redis for Lad",
"version": "1.0.6",
"version": "1.0.7",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",

@@ -6,0 +6,0 @@ "ava": {

@@ -27,21 +27,21 @@ const test = require('ava');

case 'redis connection established':
t.true(true);
t.pass();
break;
case 'redis connection ready':
t.true(true);
t.pass();
break;
case 'redis connection closed':
t.true(true);
t.pass();
break;
case 'redis reconnecting':
t.true(true);
t.pass();
break;
case 'redis connection ended':
t.true(true);
t.pass();
break;
case 'redis node connected':
t.true(true);
t.pass();
break;
case 'redis node disconnected':
t.true(true);
t.pass();
break;

@@ -55,6 +55,6 @@ default:

case 'node error':
t.true(true);
t.pass();
break;
case 'error':
t.true(true);
t.pass();
break;

@@ -87,27 +87,27 @@ default:

case 'redis monitor instance created':
t.true(true);
t.pass();
break;
case 'redis monitor':
t.true(true);
t.pass();
break;
case 'redis connection established':
t.true(true);
t.pass();
break;
case 'redis connection ready':
t.true(true);
t.pass();
break;
case 'redis connection closed':
t.true(true);
t.pass();
break;
case 'redis reconnecting':
t.true(true);
t.pass();
break;
case 'redis connection ended':
t.true(true);
t.pass();
break;
case 'redis node connected':
t.true(true);
t.pass();
break;
case 'redis node disconnected':
t.true(true);
t.pass();
break;

@@ -122,6 +122,6 @@ default:

case 'node error':
t.true(true);
t.pass();
break;
case 'error':
t.true(true);
t.pass();
break;

@@ -153,3 +153,3 @@ default:

// console.debug(args);
if (args[1].status === '[empty]') t.true(true);
if (args[1].status === '[empty]') t.pass();
};

@@ -167,3 +167,3 @@

logger.error = (message) => {
if (message === 'error') t.true(true);
if (message === 'error') t.pass();
};

@@ -180,1 +180,46 @@

});
test('creates Redis with logger and does not bind events', async (t) => {
const { logger } = t.context;
logger.debug = (message) => {
switch (message) {
case 'redis connection established':
t.fail();
break;
case 'redis connection ready':
t.fail();
break;
case 'redis connection closed':
t.fail();
break;
case 'redis reconnecting':
t.fail();
break;
case 'redis connection ended':
t.fail();
break;
case 'redis node connected':
t.fail();
break;
case 'redis node disconnected':
t.fail();
break;
default:
}
};
const redis = await new Redis({}, logger, undefined, undefined, false);
t.is(typeof redis, 'object');
redis.monitor();
await delay(1000);
redis.emit('reconnecting');
redis.emit('+node');
redis.emit('-node');
redis.emit('node error', 'node error');
t.throws(() => {
redis.emit('error', 'error');
});
redis.disconnect();
await delay(1000);
});
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