[英]NodeJS: Spawn child process, and capture stdout of grandchild process?
我正在尝试使用child_process
启动一个进程,并且该进程本身会产生另一个进程。 我正在尝试捕获孙进程标准输出或检测它正在关闭。 出现了几个问题。
const spawn = require('child_process').spawn;
let childProcess = spawn('pathToExe', ['exeArgs'], {stdio: 'pipe'});
childProcess.stdout.on('data', (data) => {
// Here I can capture the child process STDOUT
// The child process closes instantly after spawning the 'grandchild'
});
如何查看子进程产生的子进程,并检测它何时关闭或退出?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.