JavaScript port for node.js and browser

I was looking to make something like this but then I found this project so I decided to port it to JavaScript instead.