git ssb

0+

cel-desktop / ssb-pkg



Tree: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f

Files: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f / test / test-50-spawn / test-cpfork-a-1.js

460 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 );
15} catch (e) {
16 console.log(e.message);
17}
18
19child.on('message', function (value) {
20 console.log(value.toString());
21 child.send(value);
22});
23
24child.send(2);
25
26child.on('exit', function (code) {
27 console.log('Child exited with code', code);
28});
29

Built with git-ssb-web