Registry / database / systemic-redis

systemic-redis

JSON →
library3.0.2jsnpmunverified

A systemic redis component that integrates Redis into the systemic dependency injection framework. Current stable version is 3.0.2, released under a correction of serious versioning issues in the 2.x line (2.1.0–2.2.0 contain undocumented breaking changes and are discouraged). The package wraps the ioredis client and provides lifecycle management (connect, disconnect) within systemic's component model. Compared to raw ioredis usage, it offers declarative configuration and automatic connection handling, but requires understanding of systemic's patterns. Version 3.0.0 introduced breaking changes from 2.0.1, and the package only supports Node >=10. Release cadence is sporadic, with long gaps between versions.

npm install systemic-redis
INSTALL
IMPORT
SIG · SYSTEMIC-REDIS
S
systemic-redis
databasejavascriptv3.0.2
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.

default
const redis = require('systemic-redis')
import redis from 'systemic-redis'
The package is CommonJS-only; ESM import will fail.
redis (named export)
const { redis } = require('systemic-redis')
// No wrong pattern for named export, but note that this is equivalent to default.
System (from systemic)
const System = require('systemic')
import { System } from 'systemic'
systemic is also CommonJS-only; avoid ESM imports.

Demonstrates basic usage: configure Redis URL, add to systemic, start and interact with Redis client.

const System = require('systemic'); const redis = require('systemic-redis'); new System() .configure({ redis: { url: process.env.REDIS_URL ?? 'redis://127.0.0.1/1' } }) .add('logger', console) .add('redis', redis()).dependsOn('config', 'logger') .start((err, components) => { if (err) { console.error('Failed to start', err); process.exit(1); } components.redis.client.set('key', 'value', (err, result) => { if (err) console.error(err); else console.log('Set succeeded:', result); components.redis.client.get('key', (err, value) => { console.log('Got:', value); process.exit(0); }); }); });
Debug
Known issues
breakingUpgrading from 2.0.1 to 2.1.0, 2.1.1, or 2.2.0 is discouraged due to incorrect versioning and breaking changes.
fix
Upgrade directly from 2.0.1 to 3.0.0 or later.
affects: >=2.1.0 <3.0.0
breakingVersion 3.0.0 includes breaking changes from 2.0.1; check the changelog for details.
fix
Refer to the migration guide in the repo's release notes.
affects: >=3.0.0
gotchaThe package does not provide TypeScript definitions; users must create their own or use @types/ioredis for the client.
fix
Install @types/ioredis and declare module augmentation for systemic-redis.
affects: all
deprecatedNode.js 10 is in end-of-life; consider upgrading to Node 14+.
fix
Upgrade Node.js version.
affects: <=10
Errors
Common errors & fixes
Error: Cannot find module 'systemic-redis'
Missing dependency or incorrect import path.
fix
Ensure 'systemic-redis' is listed in package.json and npm install was run.
TypeError: redis is not a function
Using the result of require('systemic-redis') directly as a function without calling it.
fix
Use redis() as a factory: const redisComponent = require('systemic-redis')();
Error: CONFIG is not defined
The config component is missing or not properly provided.
fix
Ensure .configure() sets redis.url or provide a config component with the 'redis' key.
Error: Redis connection to 127.0.0.1:6379 failed
Redis server is not running or unreachable.
fix
Start Redis server or check REDIS_URL environment variable.
Upgrade
Version history
3.0.2latest on npm
Audit
Dependencies
systemicrequiredCore dependency: the component is designed to be used within a systemic application
ioredisrequiredPeer dependency: uses ioredis under the hood for Redis connectivity
Agent activity
22 hits · last 30 days
node
16
Meta
2
Amazon
1
OpenAI (training)
1
Resources
systemic-redis — npm install systemic-redis · libregistry