1.0.1 • Published 11 months ago
@zowanet/composite-url v1.0.1
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"