git ssb

0+

cel-desktop / ssb-pkg



Tree: 65191f9a9664f013ebe726bb95a1a54b086e1bd5

Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / 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