We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2978ac commit d9895c4Copy full SHA for d9895c4
doc/api/url.md
@@ -971,6 +971,20 @@ changes:
971
The `url.format()` method returns a formatted URL string derived from
972
`urlObject`.
973
974
+```js
975
+url.format({
976
+ protocol: 'https',
977
+ hostname: 'example.com',
978
+ pathname: '/some/path',
979
+ query: {
980
+ page: 1,
981
+ format: 'json'
982
+ }
983
+});
984
+
985
+// => 'https://example.com/some/path?page=1&format=json'
986
+```
987
988
If `urlObject` is not an object or a string, `url.format()` will throw a
989
[`TypeError`][].
990
0 commit comments