url-to-options
![Build Status](https://camo.githubusercontent.com/2f1c9e1389bf1008c691e328426024987d47697256ebab8bad1bc0e3b2d33c39/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73746576656e766163686f6e2f75726c2d746f2d6f7074696f6e732e737667)
Convert a WHATWG
URL
to anhttp.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, … }