git ssb

0+

cel-desktop / ssb-pkg



Tree: d456a6cc8589489e558e6164750474ed2cfc961e

Files: d456a6cc8589489e558e6164750474ed2cfc961e / test / test-50-spawn / test-spawn-a-2.js

530 bytesRaw
1#!/usr/bin/env node
2
3'use strict';
4
5var path = require('path');
6var spawn = require('child_process').spawn;
7
8if (process.send) {
9 require('./test-spawn-a-child.js');
10 return;
11}
12
13var child = spawn(
14 process.execPath, [ path.basename(__filename), 'argvx', '--argvy' ],
15 { stdio: [ 'inherit', 'inherit', 'inherit', 'ipc' ] }
16);
17
18child.on('message', function (value) {
19 console.log(value.toString());
20 child.send(value);
21});
22
23child.send(2);
24
25child.on('exit', function (code) {
26 console.log('Child exited with code', code);
27});
28

Built with git-ssb-web