Registry / devops / redis-app-rpf

redis-app-rpf

JSON →
library0.7.18jsnpmunverified

Redis application archetype providing lifecycle boilerplate for Node.js apps that use Redis. Current version 0.7.18, relatively stable with infrequent releases. It wraps common startup patterns: config extraction from environment variables via app-spec, graceful shutdown, and error handling. Differentiates by offering a minimal, opinionated framework for small Redis-based microservices, popular in the evanx ecosystem (e.g., scan-expire, retask).

npm install redis-app-rpf
INSTALL
IMPORT
SIG · REDIS-APP-RPF
R
redis-app-rpf
devopsjavascriptv0.7.18
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 redisApp = require('redis-app-rpf');
import redisApp from 'redis-app-rpf';
Package is CommonJS only; ESM import will fail.
redisApp
const redisApp = require('redis-app-rpf');
const { redisApp } = require('redis-app-rpf');
No named export; default export is a function.
function call
redisApp(pkg, spec, main).catch(err => console.error(err));
redisApp({ pkg, spec, main });
Arguments are positional, not an options object.

Initializes a Redis app with env-based config, periodic ping, and error handling.

const redisApp = require('redis-app-rpf'); const pkg = require('./package.json'); const spec = { redisUrl: { env: 'REDIS_URL', default: 'redis://localhost:6379' }, interval: { env: 'INTERVAL', default: '5000' } }; const main = async ({ config, redis, logger }) => { logger.info('App started with config:', config); setInterval(() => { redis.ping().then(res => logger.info('Redis ping:', res)); }, config.interval); }; redisApp(pkg, spec, main).catch(err => { console.error(err); process.exit(1); });
Debug
Known issues
gotchaPackage is CommonJS only; do not use ES `import` syntax.
fix
Use `require('redis-app-rpf')` instead of `import`.
affects: >=0.0.0
gotchaArguments must be passed as separate positional parameters, not as an object.
fix
Call `redisApp(pkg, spec, main)`, not `redisApp({ pkg, spec, main })`.
affects: >=0.0.0
gotchaThe `main` function must be async and accept a single object with `config`, `redis`, `logger`, etc.
fix
Ensure `main` signature is `async ({ config, redis, logger }) => { ... }`.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: redisApp is not a function
Using `import` instead of `require`, or destructuring the default export.
fix
Use `const redisApp = require('redis-app-rpf');` and call it as a function.
Error: Cannot find module 'app-spec'
Missing peer dependency `app-spec`.
fix
Run `npm install app-spec` to install the required peer dependency.
TypeError: Cannot destructure property 'config' of 'undefined' or 'null'
The `main` function is not receiving the expected argument object.
fix
Check that `main` is async and accepts a single object parameter.
Upgrade
Version history
0.7.18latest on npm
Audit
Dependencies
app-specrequiredUsed to define and validate environment variable config spec
Agent activity
6 hits · last 30 days
node
6
Resources
redis-app-rpf — npm install redis-app-rpf · libregistry