Registry / storage / hubot-redis-brain

hubot-redis-brain

JSON →
library3.0.1jsnpmunverified

A hubot script to persist hubot's brain using redis. Current stable version: 3.0.1. Release cadence: low, maintenance-only updates. It extends Hubot's in-memory brain by storing data in Redis, enabling state persistence across restarts. Key differentiators: simple setup via REDIS_URL, supports authentication, UNIX sockets, and key prefixes. Requires a Redis server and Hubot >= 11. Peer dependency on hubot with engines >= 18.

npm install hubot-redis-brain
INSTALL
IMPORT
SIG · HUBOT-REDIS-BRAIN
H
hubot-redis-brain
storagejavascriptv3.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RedisBrain
import { RedisBrain } from 'hubot-redis-brain'
const RedisBrain = require('hubot-redis-brain')
Since v3, the package is ESM-only. Use named import.
export default
export default RedisBrain
module.exports = RedisBrain
CJS require is not supported; use ESM syntax.
TypeScript types
import type { RedisBrain } from 'hubot-redis-brain'
Package ships TypeScript definitions since v3.

Shows how to import and use RedisBrain with Hubot, set REDIS_URL, and manipulate brain data.

import { RedisBrain } from 'hubot-redis-brain'; // In your Hubot adapter const brain = new RedisBrain(robot); robot.brain = brain; // Or simply add 'hubot-redis-brain' to external-scripts.json process.env.REDIS_URL = 'redis://localhost:6379/0'; robot.loadExternalScripts(['hubot-redis-brain']); // Save data robot.brain.set('key', 'value'); console.log(robot.brain.get('key')); // 'value'
Debug
Known issues
breakingv3.0.0 switched to ESM-only, dropping CommonJS require.
fix
Use `import` instead of `require()`. Update your Hubot project to ESM or use dynamic import.
affects: >=3.0.0
deprecatedREDIS_NO_CHECK environment variable is deprecated; use Redis client option `redisOptions.readyCheck` instead.
fix
Set `redisOptions: { readyCheck: false }` in the Redis client configuration.
affects: >=2.0.0
gotchaIf using Twemproxy, INFO command is not supported; set REDIS_NO_CHECK=1 or readyCheck: false.
fix
Set environment variable REDIS_NO_CHECK=1 before starting Hubot.
affects: all
gotchaThe brain data is stored with a prefix (from REDIS_URL path) and ':storage' key.
fix
Be consistent with REDIS_URL across restarts to avoid losing data.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'hubot-redis-brain'
Package not installed or CommonJS require used in ESM environment.
fix
npm install hubot-redis-brain --save and use `import` instead of `require()`.
Redis connection error: connect ECONNREFUSED 127.0.0.1:6379
Redis server not running or REDIS_URL misconfigured.
fix
Start Redis server or set REDIS_URL to a valid Redis instance.
TypeError: robot.brain.set is not a function
Hubot brain not properly initialized with RedisBrain.
fix
Ensure RedisBrain is loaded via external-scripts.json or manually instantiated before using brain methods.
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies
hubotrequiredpeer dependency, Hubot must be installed to use this script
redisrequiredruntime dependency for Redis client
Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
hubot-redis-brain — npm install hubot-redis-brain · libregistry