title: node.js cluster get all workers info
body: <p>According to node.js documentation, the cluster class should have a workers object and it can be iterated like this:</p>
  
  <pre><code>Object.keys(cluster.workers).forEach((id) =&gt; {
       cluster.workers[id].on('message', messageHandler);
    });
  </code></pre>
  
  <p>but for some reason when I try this in my code, cluster.workers is undefined (process launched with pm2)</p>
  
  <pre><code>var cluster     = require("cluster");
  console.log("cluster status : " , cluster.isMaster ?  " master " : " slave " , " - worker id "  , (cluster.worker ? cluster.worker.id : " none ") , " workers : " , cluster.workers);
  </code></pre>
  
  <p>I got output like this:</p>
  
  <pre><code>cluster status : slave - worker id 15 workers : undefined
  cluster status : slave - worker id 14 workers : undefined
  </code></pre>
  
  <p>so I guess workers are only available from master , but is there a way to communicate with other slaves for a slave ? </p>