
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
worker-communication
Advanced tools
This module provide bilateral communication with callback between cluster worker and master, node.js child process is supported too.
This module provide bilateral communication with callback between cluster worker and master, node.js child process is supported too.
npm i worker-communication
import CPC from 'worker-communication';
import * as cluster from 'cluster';
// or childProcess from 'child_process'
const cpc = new CPC();
const worker = cpc.tunnel(cluster.fork())
// or cpc.tunnel(childProcess.fork('./worker.js'));
cpc.onWorker('requestJob', (req, res) => {
res({
reqHeader: req,
timestamp: Date.now()
}, null);
});
worker.sendJob('idle', 'just relax...');
child_process.fork())import CPC from 'worker-communication';
const cpc = new CPC();
cpc.onMaster('idle', (req) => {
console.log(req);
// output: just relax...
});
let reqHeader = [123, 456];
cpc.sendJob('requestJob', reqHeader, (jobHeader, job) => {
console.log(jobHeader);
// output: { reqHeader: [123, 456], timestamp: 1577252484830 }
console.log(job);
// output: null
});
Master & worker is relative, a worker can also be a master to the process it forks.
So in this scenario, onMater() and onWorker() can be used at the same time to communicate its master and worker.
FAQs
This module provide bilateral communication with callback between cluster worker and master, node.js child process is supported too.
We found that worker-communication demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.