node.js - spawn vs exec in nodejs - child_process -
lately started learning node.js.i have situation have call multiple (say - 6 shell) scripts.each script returns different json,at end have create new json picking necessary fields json's each script returns using node , express.
eg: script json output:{"firstname":"xxx","lastname":"yyyy","account":"1234"}. understand difference between spawn , exec: referred blog - http://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html
since 'exec' has buffer limit,i confused perfect fit scenario. trying figure out way execute script in parallel , return output of 6 shell scripts.
it's little bit late if want execute script in parallel check async module.
https://github.com/caolan/async
check parallel method.
Comments
Post a Comment