-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsys.js
More file actions
40 lines (23 loc) · 666 Bytes
/
sys.js
File metadata and controls
40 lines (23 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const { spawn } = require('child_process');
const { stdout } = require('process');
const a1 = spawn('a.exe');
const a2 = spawn('python', ['msgqueue.py'])
a1.stdout.on('data', (data) => {
a2.stdin.end(data);
});
a1.stderr.on('data', (data) => {
console.error(data.toString());
});
a1.on('exit', (code) => {
console.log(`Child exited with code ${code}`);
});
a2.stdout.on('data', (data) => {
console.log(`이게되네...`);
});
a2.stderr.on('data', (data) => {
console.error(data.toString());
});
a2.on('exit', (code) => {
console.log(`Child2 exited with code ${code}`);
});
setInterval(() => { a1.stdin.end(`1`) }, 3000)