# parse-uri

> Lightweight module for parsing an URI

Latest version **2.0.6** (published 2026-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse-uri
pnpm add parse-uri
yarn add parse-uri
bun add parse-uri
```

## Health

**Score 58/100 (C)** — status: active.

Positive: has types package; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.6 |
| Published | 2026-04-14 |
| First published | 2016-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/parse-uri) |
| Module format | CommonJS |
| Node | >= 0.10 |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Kiko Beats |
| Maintainers | kikobeats |
| Keywords | URI, parse |

## Links

- npm: https://www.npmjs.com/package/parse-uri
- Repository: https://github.com/kikobeats/parse-uri
- Homepage: https://github.com/Kikobeats/parse-uri
- Issues: https://github.com/Kikobeats/parse-uri/issues
- npm.io page: https://npm.io/package/parse-uri

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.0.6 (latest) — 2026-04-14
- 2.0.5 — 2026-03-18
- 2.0.4 — 2025-11-22
- 2.0.3 — 2025-10-14
- 2.0.2 — 2025-09-04
- 2.0.0 — 2025-06-28
- 1.0.16 — 2025-06-28
- 1.0.15 — 2025-06-28
- 2.0.1 — 2025-06-28
- 1.0.14 — 2025-06-28
- 1.0.13 — 2025-06-28
- 1.0.12 — 2025-06-28
- 1.0.11 — 2025-04-04
- 1.0.10 — 2025-04-03
- 1.0.9 — 2023-10-24
- … 8 more at https://npm.io/package/parse-uri/versions

## README

# parse-uri

![Last version](https://img.shields.io/github/tag/Kikobeats/parse-uri.svg?style=flat-square)
[![Coverage Status](https://img.shields.io/coveralls/Kikobeats/parse-uri.svg?style=flat-square)](https://coveralls.io/github/Kikobeats/parse-uri)
[![NPM Status](http://img.shields.io/npm/dm/parse-uri.svg?style=flat-square)](https://www.npmjs.org/package/parse-uri)

> Lightweight module for parsing an URI Based in [Steven Levithan](http://blog.stevenlevithan.com/archives/parseuri) method.

## Install

```bash
$ npm install parse-uri --save
```

## Usage

```js
const parseUri = require('parse-uri')

parseUri('myURL')
```

## API

### parseURI(str, [options])

#### options

##### strictMode

Type: `boolean`
Default: `false`

Determinate if use `loose` or `strict` mode.

> Loose mode deviates slightly from the official generic URI spec ([RFC 3986](http://tools.ietf.org/html/rfc3986))

### Benchmark

Compared vs `parseuri`:

```
============================================================
simple          | parse-uri is 3302.0% faster
basic           | parse-uri is 1370.8% faster
complex         | parse-uri is 967.7% faster
mailto          | parse-uri is 1493.3% faster
tel             | parse-uri is 3296.8% faster
ftp             | parse-uri is 1641.9% faster
file            | parse-uri is 3305.7% faster
data            | parse-uri is 3030.4% faster
javascript      | parse-uri is 2992.0% faster
custom          | parse-uri is 1196.0% faster
longUrl         | parse-uri is 547.1% faster
unicodeUrl      | parse-uri is 1005.6% faster
============================================================

🏆 Overall Winner: parse-uri (2058.1% faster on average)
```

See more numbers at [benchmark](/benchmark/README.md).

### Related

- [is-uri](https://github.com/Kikobeats/is-uri#is-uri) – Determinate if a string is a valid URI.

## License

MIT © [Kiko Beats](http://kikobeats.com)

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