Node DOM URLs
If you find incompatibilities, please report them. Error handling is currently very different from the spec.
npm install dom-urls
var URL = ;var url = 'relative' '';urlprotocol; // 'http:'urlhostname; // 'example.com'urlpathname; // '/sub/relative/'urlhost = 'example.net:8080';urlport; // '8080'
urijs instead of
I tried it first, but Node's own URL module doesn't propagate changes, so
host doesn't affect the port and vice-versa and I didn't want to
reimplement all of that myself.