url-to-options

2.0.0 • Public • Published

url-to-options NPM Version Build Status

Convert a WHATWG URL to an http.request/https.request options object.

Installation

Node.js >= 8 is required. To install, type this at the command line:

npm install url-to-options

Usage

const urlToOptions = require('url-to-options');
 
const url = new URL('http://user:pass@hostname:8080/');
 
const opts = urlToOptions(url);
//-> { auth:'user:pass', port:8080, … }

Readme

Keywords

Package Sidebar

Install

npm i url-to-options

Weekly Downloads

2,129,661

Version

2.0.0

License

MIT

Unpacked Size

3.13 kB

Total Files

4

Last publish

Collaborators

  • stevenvachon