title: How to terminate child process on node.js?
body: <p>I have a few child processes of node, that depends from master. Every process is a program with some asynchronic logic. And i have to terminate this process when all will be done. But process not terminate by himself, cause there some listeners on it. Example:</p>
  
  <pre><code>    if (cluster.isMaster) {
  
        for (var i = 0; i &lt; numCPUs; i++) {
          let worker = cluster.fork();
          worker.send(i);
        }
  
     } else {
        process.once('message', msg =&gt; {
          // here some logic
          // and after this is done, process have to terminated
          console.log(msg);
        })
      }
  </code></pre>
  
  <p>But process still working, even i using "once". I had tried to remove all of process listeners, but it still works. How i can terminate it?</p>