Updated to handle node.js export