The URL module has utilities for URL resolution and parsing.
$ volo add anchorjs/url
For more information on using volo to manage JavaScript modules, visit http://volojs.org/.
Take a URL string, and return an object.
url.parse('http://www.example.com/')Take a parsed URL object, and return a formatted URL string.
url.format({ 'protocol': 'http:',
'host': 'www.example.com',
'pathname': '/' })Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag.
url.resolve('http://example.com/a', '/b');This module conforms to the interface exported by Node's URL module.
To run tests in a browser, execute the Make target for the desired browser:
$ make test-chrome
$ make test-firefox
$ make test-safari
To run headless tests from a terminal using PhantomJS:
$ make test-phantomjs
Copyright (c) 2012-2013 Jared Hanson <http://jaredhanson.net/>
Copyright Joyent, Inc. and other Node contributors.