There is nothing wrong in your code. This is a limitation of cep.process.stdout/stderr which is targeting to capture one time of stdout/stderr output. For now, two workarounds are suggested as the following.
a. Embed cep.process.stdout/stderr, like the code below
b. Join all stdout output as one, like
var str1 = 'abcdef';
var str2 = '12345';
var str3 = 'gghhtt';
console.log(str1 + str2 + str3);
Besides, the good news is since CEP5, nodejs is integrated into CEP and your script could be executed in Html engine of CEP directly. My guess is Photoshop 15.0 will probably pick up CEP5 to involve the benefit in. Kindly let me know if you need more information.