summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorYazhong Liu <yorkiefixer@gmail.com>2014-11-20 23:46:38 +0800
committerChris Dickinson <christopher.s.dickinson@gmail.com>2014-12-02 10:55:22 -0800
commitd312b6d15c69cf4c438ed7d884e6396c481a57f6 (patch)
treeb019dbbd84e8e257cf6e3fdccc40b962abdd5ff6 /doc
parentc131c1f92043ed8cfaf7474178d54c7bc4a74226 (diff)
downloadnode-new-d312b6d15c69cf4c438ed7d884e6396c481a57f6.tar.gz
url: support `path` for url.format
this adds support for a "path" field that overrides "query", "search", and "pathname" if given. Fixes: https://github.com/joyent/node/issues/8722 PR-URL: https://github.com/joyent/node/pull/8755 Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/url.markdown9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/api/url.markdown b/doc/api/url.markdown
index 6b8ff9d507..3ace699579 100644
--- a/doc/api/url.markdown
+++ b/doc/api/url.markdown
@@ -95,11 +95,12 @@ Take a parsed URL object, and return a formatted URL string.
* `hostname` will only be used if `host` is absent.
* `port` will only be used if `host` is absent.
* `host` will be used in place of `hostname` and `port`
-* `pathname` is treated the same with or without the leading `/` (slash)
-* `search` will be used in place of `query`
+* `pathname` is treated the same with or without the leading `/` (slash).
+* `path` is treated the same with `pathname` but able to contain `query` as well.
+* `search` will be used in place of `query`.
* `query` (object; see `querystring`) will only be used if `search` is absent.
-* `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)
+* `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)