|
|
@ -1,4 +1,4 @@ |
|
|
|
## URL |
|
|
|
# URL |
|
|
|
|
|
|
|
This module has utilities for URL resolution and parsing. |
|
|
|
Call `require('url')` to use it. |
|
|
@ -45,7 +45,7 @@ string will not be in the parsed object. Examples are shown for the URL |
|
|
|
|
|
|
|
The following methods are provided by the URL module: |
|
|
|
|
|
|
|
### url.parse(urlStr, [parseQueryString], [slashesDenoteHost]) |
|
|
|
## url.parse(urlStr, [parseQueryString], [slashesDenoteHost]) |
|
|
|
|
|
|
|
Take a URL string, and return an object. |
|
|
|
|
|
|
@ -57,7 +57,7 @@ Pass `true` as the third argument to treat `//foo/bar` as |
|
|
|
`{ host: 'foo', pathname: '/bar' }` rather than |
|
|
|
`{ pathname: '//foo/bar' }`. Defaults to `false`. |
|
|
|
|
|
|
|
### url.format(urlObj) |
|
|
|
## url.format(urlObj) |
|
|
|
|
|
|
|
Take a parsed URL object, and return a formatted URL string. |
|
|
|
|
|
|
@ -75,6 +75,6 @@ Take a parsed URL object, and return a formatted URL string. |
|
|
|
* `search` is treated the same with or without the leading `?` (question mark) |
|
|
|
* `hash` is treated the same with or without the leading `#` (pound sign, anchor) |
|
|
|
|
|
|
|
### url.resolve(from, to) |
|
|
|
## url.resolve(from, to) |
|
|
|
|
|
|
|
Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag. |
|
|
|