# bare-url

> WHATWG URL implementation for JavaScript

Latest version **2.5.4** (published 2026-09-02) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.5.4 |
| Published | 2026-09-02 |
| First published | 2023-07-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 3 |
| Author | Holepunch |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/bare-url
- Repository: https://github.com/holepunchto/bare-url
- Issues: https://github.com/holepunchto/bare-url/issues
- npm.io page: https://npm.io/package/bare-url

## Dependencies (1)

- [bare-path](https://npm.io/package/bare-path.md) ^3.0.0

## Recent versions

- 2.5.4 (latest) — 2026-09-02
- 2.5.3 — 2026-09-01
- 2.5.2 — 2026-08-11
- 2.5.1 — 2026-08-07
- 2.5.0 — 2026-08-07
- 2.4.7 — 2026-08-03
- 2.4.6 — 2026-07-21
- 2.4.5 — 2026-06-04
- 2.4.4 — 2026-06-04
- 2.4.3 — 2026-05-05
- 2.4.2 — 2026-04-21
- 2.4.1 — 2026-04-18
- 2.4.0 — 2026-03-19
- 2.3.2 — 2025-10-31
- 2.3.1 — 2025-10-20
- … 54 more at https://npm.io/package/bare-url/versions

## README

# bare-url

WHATWG URL implementation for JavaScript, built on <https://github.com/holepunchto/liburl>. Provides `URL` and `URLSearchParams` classes compatible with the WHATWG URL Standard.

```
npm i bare-url
```

## Usage

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

const url = new URL('https://example.com/path?foo=bar#hash')

console.log(url.hostname) // 'example.com'
console.log(url.pathname) // '/path'
console.log(url.searchParams.get('foo')) // 'bar'
```

To register `URL` and `URLSearchParams` as globals:

```js
require('bare-url/global')
```

## API

See the [`bare-url` reference](https://docs.pears.com/reference/bare/modules/bare-url).

## License

Apache-2.0

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