Skip to content

Convert a WHATWG URL to an http(s).request options object.

License

Notifications You must be signed in to change notification settings

stevenvachon/url-to-options

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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, … }

About

Convert a WHATWG URL to an http(s).request options object.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published