git ssb

0+

cel-desktop / ssb-pkg



Tree: ca90b5ca0579ebdcc0635288bce4978e3fb200f5

Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / test / test-50-spawn / test-cpfork-b-1.js

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

Built with git-ssb-web