# url-to-options

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

Latest version **2.0.0** (published 2019-04-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install url-to-options
pnpm add url-to-options
yarn add url-to-options
bun add url-to-options
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-04-23 |
| First published | 2017-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Steven Vachon |
| Maintainers | stevenvachon |
| Keywords | http, https, url, whatwg |

## Links

- npm: https://www.npmjs.com/package/url-to-options
- Repository: https://github.com/stevenvachon/url-to-options
- Homepage: https://github.com/stevenvachon/url-to-options#readme
- Issues: https://github.com/stevenvachon/url-to-options/issues
- npm.io page: https://npm.io/package/url-to-options

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2019-04-23
- 1.0.1 — 2017-06-06
- 1.0.0 — 2017-06-06

## README

# 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/) `>= 8` 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

---
_Source: https://npm.io/package/url-to-options · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
