Change from PHP to NodeJs