catch output in node.js