Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

parse-uri

kikobeats435.2kMIT2.0.0TypeScript support: definitely-typed

Lightweight module for parsing an URI

URI, parse

readme

parse-uri

Last version Coverage Status NPM Status

Lightweight module for parsing an URI Based in Steven Levithan method.

Install

$ npm install parse-uri --save

Usage

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)

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.

  • is-uri – Determinate if a string is a valid URI.

License

MIT © Kiko Beats

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

2.0.0 (2025-06-28)

⚠ BREAKING CHANGES

  • spec compliant

Features

Bug Fixes

  • resolve protocols properly (290cdc3)

1.0.12 (2025-06-28)

1.0.11 (2025-04-04)

1.0.10 (2025-04-03)

1.0.9 (2023-10-24)

1.0.8 (2023-09-05)

1.0.7 (2022-03-02)

1.0.6 (2022-02-25)

1.0.5 (2022-02-04)

1.0.4 (2022-02-04)

1.0.0 (2016-02-04)