helper functions for node.js