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