The URL module has utilities for URL resolution and parsing.
$ component install anchorjs/url
$ volo add anchorjs/url
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 uses the AMD format. To include in component builds, use component-amd:
component build -u component-amd
This module implements 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
Headless tests can be executed directly from a terminal:
$ make test-phantomjs
Copyright (c) 2012-2013 Jared Hanson <http://jaredhanson.net/>
Copyright Joyent, Inc. and other Node contributors.