Closed
Description
this won't work reliable (but it should according to the docs):
var empty = new Buffer(0)
process.stdout.write(empty, function() {
process.stderr.write(empty, function() {
process.exit(code);
});
});
Not all data is flushed when node.js ends and thus another process using its output will not get all written data.
It also doesn't help to use something like
stream.pipe(process.stdout);
stream.push(null);
That .end() throws and an finish is never emitted makes using process.stdout/.stderr something like lottery.
Also trying to workaround via
fs.createWritableStream(null, {fd:1});
leads to another bunch of problems like EAGAIN errors.
I would suggest to implement .end() and finish events so that both process.stdout and .stderr behave like any other stream.