A distributed circuit breaker coordinated via Redis for high-availability applications. Current stable version is 1.2.0, released as an npm package with TypeScript types. The library uses Redis Streams for state coordination across multiple instances, supports multiple breaker strategies (consecutive, count-based, time-based) and backoff strategies (constant, exponential), includes built-in leader election for health checks, and offers optional Prometheus metrics via @zenvark/prom. It differentiates by focusing on distributed environments with leader election and Redis-backed coordination, unlike single-process circuit breakers.
npm install zenvarkNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a distributed circuit breaker using Redis, with consecutive failure threshold, constant backoff, and health check.
Run 'npm install ioredis' alongside zenvark.
Use import syntax or set 'type': 'module' in package.json. For Node <22, upgrade to Node >=22 or use a previous version.
Use import { CircuitBreaker } from 'zenvark' instead of import CircuitBreaker from 'zenvark'.Ensure options.redis is a valid ioredis.Redis instance and options.breaker is one of ConsecutiveBreaker or CountBreaker.
Instantiate a backoff strategy explicitly: new ConstantBackoff({ delayMs: 5000 }).Run 'npm install ioredis' to add the required peer dependency.
Change to import { CircuitBreaker } from 'zenvark'.Start Redis server or provide correct REDIS_URL environment variable.
Add 'type': 'module' to package.json or rename .js files to .mjs.