Forky (v1.2.0) simplifies Node.js cluster management by automatically forking workers equal to the number of CPU cores. It auto-restarts crashed workers and supports graceful shutdown via the `suicide` flag. Unlike alternatives like `pm2` or `cluster` alone, forky is lightweight, zero-config for basic setups, and keeps the worker code unmodified. It ships TypeScript types and is suitable for Node >=8. Development appears stale (last commit 2019); no major release since.
npm install forkyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic forky usage: master forking workers from a separate file, worker with HTTP server and graceful shutdown.
Ensure the path is absolute or resolved correctly relative to the master process.
Use `worker.exitedAfterDisconnect` instead.
Implement custom signal handlers in the master process to disconnect workers.
Add error handling or a max restarts limit via process.on('uncaughtException') in workers.Use `process.send()` and `cluster.on('message')` as documented.Use __dirname + '/worker.js' or an absolute path.
Have each worker listen on a different port (e.g., 8000 + worker.id) or use a reverse proxy.
Use `import forky from 'forky'` or `const forky = require('forky')`.No dependency data recorded yet.