# universal-url

> WHATWG URL for Node & Browser.

Latest version **2.0.0** (published 2018-11-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install universal-url
pnpm add universal-url
yarn add universal-url
bun add universal-url
```

## 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 | 2018-11-28 |
| First published | 2017-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6 |
| Dependencies | 2 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Steven Vachon |
| Maintainers | stevenvachon |
| Keywords | uri, url, whatwg |

## Links

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

## Dependencies (2)

- [hasurl](https://npm.io/package/hasurl.md) ^1.0.0
- [whatwg-url](https://npm.io/package/whatwg-url.md) ^7.0.0

## 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) — 2018-11-28
- 1.0.1 — 2018-08-01
- 1.0.0 — 2017-06-29
- 1.0.0-alpha — 2017-04-21

## README

# universal-url [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Monitor][greenkeeper-image]][greenkeeper-url]

> WHATWG [`URL`](https://developer.mozilla.org/en/docs/Web/API/URL) for Node & Browser.


* For Node.js versions `>= 8`, the native implementation will be used.
* For Node.js versions `< 8`, a [shim](https://npmjs.com/whatwg-url) will be used.
* For web browsers without a native implementation, the same shim will be used.


## Installation

[Node.js](http://nodejs.org/) `>= 6` is required. To install, type this at the command line:
```shell
npm install universal-url
```


## Usage

```js
const {URL, URLSearchParams} = require('universal-url');

const url = new URL('http://domain/');
const params = new URLSearchParams('?param=value');
```

Global shim:
```js
require('universal-url').shim();

const url = new URL('http://domain/');
const params = new URLSearchParams('?param=value');
```


## Browserify/etc

The bundled file size of this library can be large for a web browser. If this is a problem, try using [universal-url-lite](https://npmjs.com/universal-url-lite) in your build as an alias for this module.


[npm-image]: https://img.shields.io/npm/v/universal-url.svg
[npm-url]: https://npmjs.org/package/universal-url
[travis-image]: https://img.shields.io/travis/stevenvachon/universal-url.svg
[travis-url]: https://travis-ci.org/stevenvachon/universal-url
[greenkeeper-image]: https://badges.greenkeeper.io/stevenvachon/universal-url.svg
[greenkeeper-url]: https://greenkeeper.io/

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