A URL module that contains tools for parsing and parsing URLs.
var url = require (' URL ');
Url.parse (urlstr[, parsequerystring][, Slashesdenotehost]) The first argument, enter the URL string, and return an object.
var url = require (' URL '); Url.parse (' http://www.tianh.top ');
{protocol: ' http: ' null , hostname: ' www.tianh.top ' null null , query: null pathname: '/' Span style= "color: #000000;" > path: '/' ' http://www.tianh.top/'}
The second argument is a Boolean value, and if true it is, the query property will always be assigned to the object, and search the property will always be a string (possibly empty). Default is False
The third parameter is also a Boolean value that parses//and next/between the strings parsed into host,/after parsing into pathname. Default is False
Url.format (urlobj) enters a parsed URL object, returning the formatted string.
Url.resolve (from, to) stitching BaseURL and Hrefurl.
NodeJS Study notes (ii)