Registry / monitoring / redis-status

redis-status

JSON →
library1.0.3jsnpmunverified

A Node.js module that checks the health of a Redis server, suitable for use by a service's health route. v1.0.3 is the current stable release. It connects to Redis only to check status and then disconnects. Lightweight alternative to more complex health-check libraries; designed for simple monitoring integrations like Pingdom.

npm install redis-status
INSTALL
IMPORT
SIG · REDIS-STATUS
R
redis-status
monitoringjavascriptv1.0.3
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.

redisStatus
const redisStatus = require('redis-status'); const fooStatus = redisStatus({ name: 'foo', port: 6379, host: 'localhost' });
import redisStatus from 'redis-status';
The module exports a factory function, not a class or object.
checkStatus
fooStatus.checkStatus(function(err) { ... });
fooStatus.checkStatus().then(...)
checkStatus uses a callback pattern, not Promises.
require usage
const redisStatus = require('redis-status');
const redisStatus = require('redis-status').default;
No default export; the factory is exported directly.

Shows how to create a Redis health check and integrate with Express health endpoint.

const express = require('express'); const router = express.Router(); const redisStatus = require('redis-status'); const fooStatus = redisStatus({ name: 'foo', port: parseInt(process.env.REDIS_PORT ?? '6379'), host: process.env.REDIS_HOST ?? 'localhost' }); router.get('/health', (req, res) => { fooStatus.checkStatus((err) => { res.send(err || 'great'); }); }); const app = express(); app.use(router); app.listen(3000);
Debug
Known issues
breakingVersion 1.0.3 changed behavior to connect only during check and then disconnect. Previous versions kept persistent connection.
fix
No code changes needed, but connection behavior differs; adjust expectations if relying on persistent connection.
affects: 1.0.0 - 1.0.2
gotchacheckStatus uses a callback, not Promises or async/await. Mixing with Promises may lead to unhandled errors.
fix
Wrap in a Promise: new Promise((resolve, reject) => fooStatus.checkStatus(err => err ? reject(err) : resolve('great')))
affects: >=1.0.0
gotchaThe health check only verifies connectivity; it does not test Redis functionality beyond PING.
fix
If deeper health checks are needed, consider adding custom logic or using a more comprehensive library.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: redisStatus is not a function
Importing with ES module import syntax (import) instead of require.
fix
Use require('redis-status') or convert to ESM with createRequire.
Error: Redis connection to 127.0.0.1:6379 failed
Redis server not running or incorrect host/port.
fix
Start Redis server or correct host/port in configuration.
undefined is not a function (evaluating 'fooStatus.checkStatus(...)')
Calling checkStatus without first creating a status object via redisStatus().
fix
Ensure redisStatus({...}) returns an object before calling checkStatus.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
32 hits · last 30 days
node
24
OpenAI (training)
1
Resources
redis-status — npm install redis-status · libregistry