Skip to content

Commit

Permalink
[doc] Replace URL with Url (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce authored and lpinca committed Sep 21, 2018
1 parent 4e14338 commit 9fb86cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ All examples assume that this library is bootstrapped using:
```js
'use strict';

var URL = require('url-parse');
var Url = require('url-parse');
```

To parse an URL simply call the `URL` method with the URL that needs to be
transformed into an object.

```js
var url = new URL('https://github.com/foo/bar');
var url = new Url('https://github.com/foo/bar');
```

The `new` keyword is optional but it will save you an extra function invocation.
Expand Down Expand Up @@ -100,7 +100,7 @@ var parse = require('url-parse');
parse('hostname', {});
```

### URL.set(key, value)
### Url.set(key, value)

A simple helper function to change parts of the URL and propagating it through
all properties. When you set a new `host` you want the same value to be applied
Expand All @@ -117,7 +117,7 @@ console.log(parsed.href); // http://yahoo.com/parse-things
It's aware of default ports so you cannot set a port 80 on an URL which has
`http` as protocol.

### URL.toString()
### Url.toString()

The returned `url` object comes with a custom `toString` method which will
generate a full URL again when called. The method accepts an extra function
Expand Down

0 comments on commit 9fb86cf

Please sign in to comment.