finds.dev← search

// the find

andrewrk/naught

★ 794 · JavaScript · MIT · updated Oct 2022

Zero downtime deployment for your Node.js server using builtin cluster API

A CLI and library for zero-downtime deploys of Node.js servers on top of the built-in cluster module — it spawns new workers, waits for them to report online, then kills old ones one at a time. Useful for anyone running a bare Node process without Kubernetes/PM2-style orchestration and who wants rolling restarts without a reverse-proxy dance.

The deploy algorithm itself is solid: spawn all new workers, wait for every one to signal 'online', then retire old workers one by one, with a clean abort path (including on Ctrl+C) if anything hangs. The crash-recovery trick — treating an uncaught exception as an 'offline' event that spins up a replacement worker while the dying one finishes in-flight requests — is a genuinely useful pattern most app servers don't bother implementing themselves. Built-in gzipped, size-rotated stdout/stderr logging means you don't need a separate log rotation daemon for the common case.

No commits since October 2022 — three years stale in a space (process/deploy tooling) where you really want active maintenance. The README leans on Domains for catching uncaught exceptions, an API Node has been signaling as going away for most of its life, so the recommended integration path is built on sand. POSIX-only, so it's a non-starter if any part of your deploy target is Windows. It's not drop-in: your app has to explicitly call process.send('online') and handle a 'shutdown' message, and if you skip the shutdown handler (easy to do, since most servers do have keep-alive connections) you silently lose the zero-downtime guarantee the tool is named for.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →