npm.io
1.0.1 • Published 3 years ago

@zowanet/composite-url

Licence
Unlicense
Version
1.0.1
Deps
0
Size
32 kB
Vulns
0
Weekly
0

composite-url

Install

npm install @zowanet/composite-url
yarn add @zowanet/composite-url
pnpm add @zowanet/composite-url

Import

import CompositeURL from '@zowanet/composite-url';
const { default: CompositeURL } = await import('@zowanet/composite-url');
Usage
console.log(new CompositeURL({
    protocol: 'protocol',
    username: 'username',
    password: 'password',
    hostname: 'hostname',
    port: 9999,
    pathname: 'pathname',
    search: 'search',
    hash: 'hash',
}).href); // "protocol://username:password@hostname:9999/pathname?search#hash"

console.log(new CompositeURL({
	uri: '/path/to/file?foo=bar&baz=qux#fragment',
}).pathname); // "/path/to/file"

Keywords