git ssb

0+

cel-desktop / ssb-pkg



Tree: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f

Files: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f / 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