migrate from php to node.js