
Security News
OpenClaw Skill Marketplace Emerges as Active Malware Vector
Security researchers report widespread abuse of OpenClaw skills to deliver info-stealing malware, exposing a new supply chain risk as agent ecosystems scale.
@cortec/redis
Advanced tools
@cortec/redis provides a flexible Redis integration for Node.js applications, supporting both single-node and cluster setups. It offers convenient methods for accessing Redis caches, performing health checks, and transforming objects for hash operations. The module is designed to work seamlessly with the Cortec context and configuration system.
Where to put config:
Place your Redis config in config/default.yml (or your environment-specific config file).
Schema:
redis:
cache:
connection:
host: 'localhost'
port: 6379
password: 'secret' # optional
db: 0 # optional, default: 0
maxRetries: 5 # optional, default: 5
encryption: false # optional, enables TLS if true
cluster: # optional, enables Redis Cluster mode
nodes:
- host: 'localhost'
port: 6379
- host: 'localhost'
port: 6380
Field-by-field explanation:
redis: Root key for Redis config.cache: Identity/name for this Redis instance (can be any string, e.g. "session", "main", etc.).connection: Connection options for ioredis.
host: Redis server hostname or IP.port: Redis server port.password: Password for authentication (optional).db: Database index (optional, default is 0).maxRetries: Maximum number of retry attempts before giving up (optional, default is 5).encryption: If true, enables TLS/SSL for secure connections (optional).cluster: If present, enables Redis Cluster mode.
nodes: List of cluster node objects, each with host and port.How config is loaded:
The config is loaded automatically by the @cortec/config module and validated at runtime.
Access it in code via:
const config = ctx.provide<IConfig>('config');
const redisConfig = config?.get<any>('redis');
If config is missing or invalid, an error is thrown at startup.
import CortecRedis from '@cortec/redis';
// Instantiate with optional object transformation for hash operations
const redisModule = new CortecRedis(true);
// After loading the context and configuration:
const cache = redisModule.cache('cache'); // 'cache' is the identity from config
// Set and get a value
await cache.set('key', 'value');
const value = await cache.get('key');
console.log(value); // 'value'
await redisModule.healthCheck(); // Throws if any Redis instance is unreachable
If your configuration includes a cluster section, you can access the cluster instance in the same way:
const clusterCache = redisModule.cache('clusteredCache');
await clusterCache.set('key', 'value');
If you instantiate CortecRedis with transformObjects = true, you can use objects directly with hset and get parsed objects from hgetall:
const redisModule = new CortecRedis(true);
const cache = redisModule.cache('cache');
await cache.hset('user:1', { name: 'Alice', age: 30 });
const user = await cache.hgetall('user:1');
console.log(user); // { name: 'Alice', age: 30 }
To gracefully close all Redis connections:
await redisModule.dispose();
For integration or unit tests, you can use TestableCortecRedis to spin up a disposable Redis container using testcontainers. This allows you to run tests against a real Redis instance without needing a local or shared Redis server.
You can use TestableCortecRedis together with Cortec core to run integration tests against a real, disposable Redis instance—no manual setup required.
import Cortec from '@cortec/core';
import TestableCortecRedis from '@cortec/redis/testable';
const cortec = new Cortec({ name: 'test-app', version: '1.0.0' });
const redis = new TestableCortecRedis({ version: '7.2' }, true);
cortec.use(redis);
// After Cortec is loaded:
const cache = redis.cache('cache');
await cache.set('key', 'value');
const value = await cache.get('key');
console.log(value); // 'value'
For more details, see the implementation in src/index.ts and ensure your configuration matches your deployment needs (single-node or cluster).
FAQs
<description>
We found that @cortec/redis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Security researchers report widespread abuse of OpenClaw skills to deliver info-stealing malware, exposing a new supply chain risk as agent ecosystems scale.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.