https://github.com/nuintun/uri
A simple WHATWG URI parser.
https://github.com/nuintun/uri
uri uri-parser uriparser url whatwg-url
Last synced: about 1 year ago
JSON representation
A simple WHATWG URI parser.
- Host: GitHub
- URL: https://github.com/nuintun/uri
- Owner: nuintun
- License: mit
- Created: 2017-09-11T03:06:50.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T06:28:13.000Z (about 1 year ago)
- Last Synced: 2025-04-14T07:34:06.482Z (about 1 year ago)
- Topics: uri, uri-parser, uriparser, url, whatwg-url
- Language: JavaScript
- Homepage:
- Size: 394 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# URI
> A simple WHATWG URI parser.
>
> [![NPM Version][npm-image]][npm-url]
> [![Download Status][download-image]][npm-url]
> [![Languages Status][languages-image]][github-url]
> [![Tree Shakeable][tree-shakeable-image]][bundle-phobia-url]
> [![Side Effect][side-effect-image]][bundle-phobia-url]
> [![License][license-image]][license-url]
```ts
/**
* @module URI
* @license MIT
*/
export interface ParseResult {
[key: string]: string | null | (string | null)[];
}
/**
* @class URI
*/
export declare class URI {
protocol: string | null;
username: string | null;
password: string | null;
hostname: string | null;
port: string | null;
pathname: string | null;
query: ParseResult;
fragment: ParseResult;
/**
* @constructor
* @param URI
*/
constructor(URI: string);
/**
* @property search
* @method get
*/
get search(): string;
/**
* @property hash
* @method get
*/
get hash(): string;
/**
* @method toURI
*/
toURI(): string;
/**
* @method toString
*/
toString(): string;
}
```
[npm-image]: https://img.shields.io/npm/v/@nuintun/uri?style=flat-square
[npm-url]: https://www.npmjs.org/package/@nuintun/uri
[download-image]: https://img.shields.io/npm/dm/@nuintun/uri?style=flat-square
[languages-image]: https://img.shields.io/github/languages/top/nuintun/uri?style=flat-square
[github-url]: https://github.com/nuintun/uri
[tree-shakeable-image]: https://img.shields.io/badge/tree--shakeable-true-brightgreen?style=flat-square
[side-effect-image]: https://img.shields.io/badge/side--effect-free-brightgreen?style=flat-square
[bundle-phobia-url]: https://bundlephobia.com/result?p=@nuintun/uri
[license-image]: https://img.shields.io/github/license/nuintun/uri?style=flat-square
[license-url]: https://github.com/nuintun/uri/blob/main/LICENSE