title: check if child_process has ended in node.js?
body: <p>I am creating a cakefile using node.js and want to know if a child_process has ended before moving on the next one.</p>
  
  <pre><code>{exec} = require 'child_process'
   exec 'casperjs test.js', (err, stdout, stderr) -&gt;
          err &amp;&amp; throw err
          log stdout
          if //exec has finished
            log "finished executing"
  </code></pre>