amitmtrn
8/8/2016 - 1:17 PM

process comunications via child process in nodejs

process comunications via child process in nodejs

process.on('message', (m) => {
  console.log('CHILD got message:', m);
});

process.send({ foo: 'bar' });
const child = require('child_process').fork('child.js');

child.on('message', (m) => {
  console.log('PARENT got message:', m);
});

child.send({ hello: 'world' });