git ssb

0+

cel-desktop / ssb-pkg



Tree: cfc8d49135488f7554210234b3a503c2dbd6c6a5

Files: cfc8d49135488f7554210234b3a503c2dbd6c6a5 / test / test-50-spawn / test-cpfork-a-2.js

487 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5var assert = require('assert');
6var cp = require('child_process');
7var child;
8
9assert(!process.send);
10
11try {
12 child = cp.fork(
13 require.resolve('./test-cpfork-a-child.js'),
14 [ 'argx', '--argvy' ]
15 );
16} catch (e) {
17 console.log(e.message);
18}
19
20child.on('message', function (value) {
21 console.log(value.toString());
22 child.send(value);
23});
24
25child.send(2);
26
27child.on('exit', function (code) {
28 console.log('Child exited with code', code);
29});
30

Built with git-ssb-web