Socket
Socket
Sign inDemoInstall

catbox-redis

Package Overview
Dependencies
Maintainers
5
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 4.2.0 to 4.2.1

4

lib/index.js

@@ -143,5 +143,3 @@

if ((!envelope.item && envelope.item !== 0) ||
!envelope.stored) {
if (!envelope.stored || !envelope.hasOwnProperty('item')) {
throw Error('Incorrect envelope structure');

@@ -148,0 +146,0 @@ }

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

@@ -6,0 +6,0 @@ "contributors": [

@@ -8,6 +8,6 @@ catbox-redis [![Build Status](https://travis-ci.org/hapijs/catbox-redis.svg?branch=master)](https://travis-ci.org/hapijs/catbox-redis)

## Options
- `url` - the Redis server URL (if `url` is provided, `host`, `port`, and `socket` are ignored)
- `tls` - the `tls` options passed to the underlying `ioredis` client
- `host` - the Redis server hostname. Defaults to `'127.0.0.1'`.

@@ -22,2 +22,18 @@ - `port` - the Redis server port or unix domain socket path. Defaults to `6379`.

### Use a Custom Redis Client
`catbox-redis` allows you to specify a custom Redis client. Using a custom `client` puts you in charge of lifecycle handling (client start/stop).
**Requirements**
- `client` must be compatible with the `ioredis` API
- `client` must also expose the `status` property that needs to match `ready` when connected
- `client` is ready when `client.status === 'ready'` resolves to `true`
All other options of `catbox-redis` are ignored when providing a custom `client`.
- `client` - a custom Redis client instance
## Tests

@@ -24,0 +40,0 @@

@@ -790,2 +790,21 @@

});
it('can store and retrieve falsy values such as boolean false', async () => {
const options = {
host: '127.0.0.1',
port: 6379,
partition: 'wwwtest'
};
const key = {
id: 'test',
segment: 'test'
};
const redis = new Redis(options);
await redis.start();
await redis.set(key, false, 200);
const result = await redis.get(key);
expect(result.item).to.equal(false);
});
});

@@ -792,0 +811,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