Child process events when finish
<p>There is a way to extend child_process events of nodejs
it seems that some times events are not invoked so I want to see if the process was ended and then fire event.
for example I use spawn and the process was <strong>succeeded</strong> but non of the following events was invoked, so can I track somehow via event or something when the spawn process was finished ? </p>

<pre><code>function childProcessPromise(mtd, cmd, options) {
    var child = child_process.spawn(cmd, value, opt);
    child.stdout.on('data', function (data) {
        console.log('data' + data);
    });
    child.stderr.on('data', function (data) {
        console.log('test: ' + data);
        reject(data);
    });
    child.on('close', function (code) {
        console.log("close");
    });
    child.on('error', function (err) {
        console.log(err);
    });

  });

}
</code></pre>