ubdate
This commit is contained in:
21
node_modules/url-to-options/LICENSE
generated
vendored
Normal file
21
node_modules/url-to-options/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Steven Vachon
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
29
node_modules/url-to-options/README.md
generated
vendored
Normal file
29
node_modules/url-to-options/README.md
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# url-to-options [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
|
||||
|
||||
Convert a WHATWG [URL](https://developer.mozilla.org/en/docs/Web/API/URL) to an `http.request`/`https.request` options object.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
[Node.js](http://nodejs.org/) `>= 4` is required. To install, type this at the command line:
|
||||
```shell
|
||||
npm install url-to-options
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const urlToOptions = require('url-to-options');
|
||||
|
||||
const url = new URL('http://user:pass@hostname:8080/');
|
||||
|
||||
const opts = urlToOptions(url);
|
||||
//-> { auth:'user:pass', port:8080, … }
|
||||
```
|
||||
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/url-to-options.svg
|
||||
[npm-url]: https://npmjs.org/package/url-to-options
|
||||
[travis-image]: https://img.shields.io/travis/stevenvachon/url-to-options.svg
|
||||
[travis-url]: https://travis-ci.org/stevenvachon/url-to-options
|
||||
28
node_modules/url-to-options/index.js
generated
vendored
Normal file
28
node_modules/url-to-options/index.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
// Copied from https://github.com/nodejs/node/blob/master/lib/internal/url.js
|
||||
|
||||
function urlToOptions(url) {
|
||||
var options = {
|
||||
protocol: url.protocol,
|
||||
hostname: url.hostname,
|
||||
hash: url.hash,
|
||||
search: url.search,
|
||||
pathname: url.pathname,
|
||||
path: `${url.pathname}${url.search}`,
|
||||
href: url.href
|
||||
};
|
||||
if (url.port !== '') {
|
||||
options.port = Number(url.port);
|
||||
}
|
||||
if (url.username || url.password) {
|
||||
options.auth = `${url.username}:${url.password}`;
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports = urlToOptions;
|
||||
64
node_modules/url-to-options/package.json
generated
vendored
Normal file
64
node_modules/url-to-options/package.json
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"_from": "url-to-options@^1.0.1",
|
||||
"_id": "url-to-options@1.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=",
|
||||
"_location": "/url-to-options",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "url-to-options@^1.0.1",
|
||||
"name": "url-to-options",
|
||||
"escapedName": "url-to-options",
|
||||
"rawSpec": "^1.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/bin-wrapper/got",
|
||||
"/caw",
|
||||
"/got"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz",
|
||||
"_shasum": "1505a03a289a48cbd7a434efbaeec5055f5633a9",
|
||||
"_spec": "url-to-options@^1.0.1",
|
||||
"_where": "/var/www/html/jason/WeihnachtenMelly/node_modules/caw",
|
||||
"author": {
|
||||
"name": "Steven Vachon",
|
||||
"email": "contact@svachon.com",
|
||||
"url": "https://www.svachon.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/stevenvachon/url-to-options/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Convert a WHATWG URL to an http(s).request options object.",
|
||||
"devDependencies": {
|
||||
"universal-url": "^1.0.0-alpha"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/stevenvachon/url-to-options#readme",
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"url",
|
||||
"whatwg"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "url-to-options",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/stevenvachon/url-to-options.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"version": "1.0.1"
|
||||
}
|
||||
Reference in New Issue
Block a user