Port all Ruby code to Node.js