Skip to content

Commit 468f965

Browse files
committed
Updated docs
1 parent c6e6991 commit 468f965

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

README.md

+28-12
Original file line numberDiff line numberDiff line change
@@ -80,49 +80,65 @@ yarn add parse-url
8080
const parseUrl = require("parse-url")
8181

8282
console.log(parseUrl("http://ionicabizau.net/blog"))
83-
// { protocols: [ 'http' ],
83+
// {
84+
// protocols: [ 'http' ],
8485
// protocol: 'http',
85-
// port: null,
86+
// port: '',
8687
// resource: 'ionicabizau.net',
8788
// user: '',
89+
// password: '',
8890
// pathname: '/blog',
8991
// hash: '',
9092
// search: '',
91-
// href: 'http://ionicabizau.net/blog' }
93+
// href: 'http://ionicabizau.net/blog',
94+
// query: {}
95+
// }
9296

9397
console.log(parseUrl("http://domain.com/path/name?foo=bar&bar=42#some-hash"))
94-
// { protocols: [ 'http' ],
98+
// {
99+
// protocols: [ 'http' ],
95100
// protocol: 'http',
96-
// port: null,
101+
// port: '',
97102
// resource: 'domain.com',
98103
// user: '',
104+
// password: '',
99105
// pathname: '/path/name',
100106
// hash: 'some-hash',
101107
// search: 'foo=bar&bar=42',
102-
// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash' }
108+
// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash',
109+
// query: { foo: 'bar', bar: '42' }
110+
// }
103111

104112
// If you want to parse fancy Git urls, turn off the automatic url normalization
105113
console.log(parseUrl("git+ssh://[email protected]/path/name.git", false))
106-
// { protocols: [ 'git', 'ssh' ],
114+
// {
115+
// protocols: [ 'git', 'ssh' ],
107116
// protocol: 'git',
108-
// port: null,
117+
// port: '',
109118
// resource: 'host.xz',
110119
// user: 'git',
120+
// password: '',
111121
// pathname: '/path/name.git',
112122
// hash: '',
113123
// search: '',
114-
// href: 'git+ssh://[email protected]/path/name.git' }
124+
// href: 'git+ssh://[email protected]/path/name.git',
125+
// query: {}
126+
// }
115127

116128
console.log(parseUrl("[email protected]:IonicaBizau/git-stats.git", false))
117-
// { protocols: [],
129+
// {
130+
// protocols: [ 'ssh' ],
118131
// protocol: 'ssh',
119-
// port: null,
132+
// port: '',
120133
// resource: 'github.com',
121134
// user: 'git',
135+
// password: '',
122136
// pathname: '/IonicaBizau/git-stats.git',
123137
// hash: '',
124138
// search: '',
125-
// href: '[email protected]:IonicaBizau/git-stats.git' }
139+
// href: '[email protected]:IonicaBizau/git-stats.git',
140+
// query: {}
141+
// }
126142
```
127143

128144

0 commit comments

Comments
 (0)