git ssb

0+

cel-desktop / ssb-pkg



Tree: efcf9fd06b02fa9bcd28681b4c777224e19702bb

Files: efcf9fd06b02fa9bcd28681b4c777224e19702bb / test / test-50-spawn / test-spawn-a-4.js

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

Built with git-ssb-web