@njc/url
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@njc/url

Simple url parser following RFC 3986, section 3 (2005), Does not depend on other libraries.

Usage

interface Url {

    readonly schema: string;
    readonly userinfo: string;
    readonly host: string;
    readonly port: number;
    readonly path: string;
    readonly query: string;
    readonly fragment: string;

}

/* Uses the base authority and schema with the specified path */
function UrlFrom(base: Url, path: string) : Url
function ParseUrl(url: string): Url
function UrlToString(url: Url): string

Future versions

  • Error checking on the provided string
  • Query as a list and userinfo split

Readme

Keywords

Package Sidebar

Install

npm i @njc/url

Weekly Downloads

0

Version

2.0.0

License

ISC

Unpacked Size

8.45 kB

Total Files

6

Last publish

Collaborators

  • njuancouste