Skip to content

Commit

Permalink
Docs and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Aug 6, 2015
1 parent cd58b40 commit 0bac5e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ console.log(ParseUrl("http://ionicabizau.net/blog"));
// , pathname: "/blog"
// , hash: ""
// , search: ""
// , href: "http://ionicabizau.net/blog"
// }

console.log(ParseUrl("http://domain.com/path/name?foo=bar&bar=42#some-hash"));
Expand Down Expand Up @@ -71,6 +72,7 @@ console.log(ParseUrl("[email protected]:IonicaBizau/git-stats.git"));
// , pathname: "/IonicaBizau/git-stats.git"
// , hash: ""
// , search: ""
// , href: "http://domain.com/path/name?foo=bar&bar=42#some-hash"
// }

```
Expand All @@ -85,6 +87,14 @@ Parses the input url.

#### Return
- **Object** An object containing the following fields:
- `protocols` (Array): An array with the url protocols (usually it has one element).
- `port` (null|Number): The domain port.
- `resource` (String): The url domain (including subdomains).
- `user` (String): The authentication user (usually for ssh urls).
- `pathname` (String): The url pathname.
- `hash` (String): The url hash.
- `search` (String): The url querystring value.
- `href` (String): The input url.

## How to contribute
Have an idea? Found a bug? See [how to contribute][contributing].
Expand Down
3 changes: 2 additions & 1 deletion example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ console.log(ParseUrl("http://domain.com/path/name?foo=bar&bar=42#some-hash"));
// , pathname: "/path/name"
// , hash: "some-hash"
// , search: "foo=bar&bar=42"
// , href: "http://domain.com/path/name?foo=bar&bar=42#some-hash"
// }

console.log(ParseUrl("git+ssh://[email protected]/path/name.git"));
Expand All @@ -44,5 +45,5 @@ console.log(ParseUrl("[email protected]:IonicaBizau/git-stats.git"));
// , pathname: "/IonicaBizau/git-stats.git"
// , hash: ""
// , search: ""
// , href: "http://domain.com/path/name?foo=bar&bar=42#some-hash"
// , href: "git@github.com:IonicaBizau/git-stats.git"
// }

0 comments on commit 0bac5e5

Please sign in to comment.