I\'m reading a getting started book on node.js called The Node Beginner Book and in the code below (given in the book) I don\'t understand the significance
Here's an example:
var url = "https://u:p@www.example.com:777/a/b?c=d&e=f#g";
var parsedUrl = require('url').parse(url);
...
protocol https:
auth u:p
host www.example.com:777
port 777
hostname www.example.com
hash #g
search ?c=d&e=f
query c=d&e=f
pathname /a/b
path /a/b?c=d&e=f
href https://www.example.com:777/a/b?c=d&e=f#g
And another:
var url = "http://example.com/";
var parsedUrl = require('url').parse(url);
...
protocol http:
auth null
host example.com
port null
hostname example.com
hash null
search null
query null
pathname /
path /
href http://example.com/
Node.js docs: URL Objects