exec如何实时打印调用指令返回的stdout
发布于 7 年前 作者 crmchan 7701 次浏览 来自 问答

请问下 exec调用后,如果helloword 调用执行的比较耗时(helloword 没执行完 比较耗时,边执行会边打印出对应的LOG)等到该脚本全部执行完才打印出来 exec如何实时打印调用指令返回的stdout

var exec = require(‘child_process’).exec;

exec(‘perl ./helloword.pl’,function(error,stdout,stderr){ console.log(stdout);

	  谢谢!!!
回到顶部