1
我想使用的execfile和日志标准输出,让该任务的完成百分比,但回调函数:得到的execfile标准输出上块
var child = require('child_process');
child.execFile("path/to/the/file", options, function (error, stdout, stderr) {
console.log('stdout: ' + stdout);
});
等待,直到处理完成,然后记录一切在一旦。 我如何获得信息,同时正在处理中的部分记录呢?,我也试试这个:
child.stdout.on('data', function (data) {
console.log(data);
});
,但我得到这个错误:Cannot read property 'on' of undefined"
谢谢,这工作完美。 – Alxs24