git ssb

0+

cel-desktop / ssb-pkg



Tree: 8f4b43a09aab9801bf28987edd59c2e366180327

Files: 8f4b43a09aab9801bf28987edd59c2e366180327 / test / test-50-spawn / test-spawn-a-5.js

559 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.argv[0], [
15 path.join(process.cwd(), path.basename(__filename)), 'argvx', '--argvy'
16 ], { stdio: [ 'inherit', 'inherit', 'inherit', 'ipc' ] }
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