node's url module, but for the browser