port to node.js