Welcome to mirror list, hosted at ThFree Co, Russian Federation.

child-process-spawn-node.js « fixtures « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2bf4582ea03b41b427fdbc4f0f47c2061c295d54 (plain)
1
2
3
4
5
6
7
8
9
10
11
const assert = require('assert');
const debug = require('util').debuglog('test');

function onmessage(m) {
  debug('CHILD got message:', m);
  assert.ok(m.hello);
  process.removeListener('message', onmessage);
}

process.on('message', onmessage);
process.send({ foo: 'bar' });