Files: e9d9dec1d00ff365112ca0f981bbda15e3682528 / test / test-50-spawn / test-spawn-a-3.js
452 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | var spawn = require('child_process').spawn; |
6 | |
7 | var child = spawn( |
8 | process.execPath, [ |
9 | require.resolve('./test-spawn-a-child.js'), 'argvx', '--argvy' |
10 | ], { stdio: [ 'inherit', 'inherit', 'inherit', 'ipc' ] } |
11 | ); |
12 | |
13 | child.on('message', function (value) { |
14 | console.log(value.toString()); |
15 | child.send(value); |
16 | }); |
17 | |
18 | child.send(2); |
19 | |
20 | child.on('exit', function (code) { |
21 | console.log('Child exited with code', code); |
22 | }); |
23 |
Built with git-ssb-web