- const cluster = require("cluster")
- cluster.worker // in worker
- cluster.workers // in master
cluster.fork() spawns a child process that begins executing the current script from the beginning, in contrast to the
fork() system call in C which clones the current process and continues from the instruction after the system call in both parent and child process.
The Node.js Documentation has a more complete guide to clusters here
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0