title: spawn vs exec in nodejs - child_process
body: <p>Lately I started learning node.js.I have a situation where I have to call multiple (say - 6 shell) scripts.Each script returns different json,at the end i have to create a new json by picking necessary fields from json's which each script returns using node and express.</p>
  
  <p>eg: script json output:{"firstname":"xxx","lastname":"yyyy","account":"1234"}. 
  I understand the difference between spawn and exec:
  Referred this blog - <a href="http://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html" rel="nofollow">http://www.hacksparrow.com/difference-between-spawn-and-exec-of-node-js-child_process.html</a></p>
  
  <p>Since 'exec' has buffer limit,i am confused which is the perfect fit for my scenario.
  Also i trying to figure out the way to execute script in parallel and return the output of 6 shell scripts.</p>