Version 1.1.3. A Redis-based extension of node-cron that ensures jobs run only once across a Node.js cluster, using leader election via redis-leader. Prevents duplicate execution when scaling horizontally. Requires Redis. Last release appears to be 2017 (maintenance mode).
npm install cron-clusterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize cron-cluster with a Redis client, create and start a CronJob that ticks every second.
Call the main export as a function passing a redis client.
Consider alternatives like @supercharge/cron or bull with repeatable jobs.
Ensure Redis is available or implement circuit breaker.
const { CronJob } = require('cron-cluster')(redisClient)Start Redis or configure the client with proper URL.