kurl
It's a powerfull URL parser written in JavaScript and compatible with NodeJS with a lot of features that it will help you to modify/parse easily a URL without any problem.
url-browser
An implementing of Node.js Url, common for Browser and Node.js env.