Node: How to wait until a file is completed before processing it?
Do your file's post-processing in the writeable stream's
close
event:
outs.on('close', function() {
<<spawn your process>>
});
Also, no need for the destroySoon
after the end
, they are one and the same.