git ssb

0+

cel-desktop / ssb-pkg



Tree: 65191f9a9664f013ebe726bb95a1a54b086e1bd5

Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / test / test-50-spawn / test-spawn-a-1.js

487 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, [ __filename, '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