git ssb

0+

cel-desktop / ssb-pkg



Tree: 4c58f1c6c3ddb86a97f27f0c84681d201ef1f75f

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