Convert a WHATWG URL to an http(s).request options object.
npm install url-to-options> Convert a WHATWG URL to an http.request/https.request options object.
Node.js >= 8 is required. To install, type this at the command line:
``shell`
npm install url-to-options
`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