utils for node.js streaming api