Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

catbox-redis

hapijs1.9kBSD-3-Clausedeprecated4.2.4TypeScript support: definitely-typed

This module has moved and is now available at @hapi/catbox-redis. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.

Redis adapter for catbox

cache, catbox, redis

readme

catbox-redis

Redis adapter for catbox

Build Status catbox-redis

Lead Maintainer: Marcus Poehls

Options

  • url - the Redis server URL (if url is provided, host, port, and socket are ignored)
  • host - the Redis server hostname. Defaults to '127.0.0.1'.
  • port - the Redis server port or unix domain socket path. Defaults to 6379.
  • socket - the unix socket string to connect to (if socket is provided, host and port are ignored)
  • password - the Redis authentication password when required.
  • database - the Redis database.
  • partition - this will store items under keys that start with this value. (Default: '')
  • sentinels - an array of redis sentinel addresses to connect to.
  • sentinelName - the name of the sentinel master. (Only needed when sentinels is specified)

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

The test suite expects:

  • a redis server to be running on port 6379
  • a redis server listenning to port 6378 and requiring a password: 'secret'
  • a redis server listenning on socket /tmp/redis.sock

See .travis.yml

redis-server &
npm test

changelog

Changelog

4.2.4 - 2018-11-01

Updated

  • test for Node.js v11
  • bump dependencies
  • clean up .gitignore

4.2.3 - 2018-10-09

Updated

  • fix connection issue: connection string and socket weren’t used to connect #92

4.2.2 - 2018-09-21

Added

  • Redis mock server for sentinel testing

Updated

  • refactor code to ES2015 class
  • refactor tests
  • update dependency: ioredis v3 -> v4
  • update dependency: lab v15 -> v16
  • update maintainer in readme

4.2.1 - 2018-09-07

Added

  • store boolean false values in the cache

Updated

  • removed package-lock.json from repository
  • extend readme on how to use a custom Redis client

4.2.0 - 2018-08-21

Added

  • tls options for Redis