From 9fb86cfc8d9f09a0e6ab24eedede4a9959972c2c Mon Sep 17 00:00:00 2001 From: niftylettuce Date: Fri, 21 Sep 2018 00:34:45 -0500 Subject: [PATCH] [doc] Replace URL with Url (#158) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d9dfd7a..f81f919 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 @@ -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