npm.io
0.1.8 • Published 3 years ago

@stackmeister/uri

Licence
MIT
Version
0.1.8
Deps
2
Size
16 kB
Vulns
0
Weekly
0

@stackmeister/uri

A small set of URI utility functions.

Install

// Yarn
yarn add @stackmeister/uri

// NPM
npm i @stackmeister/uri

TypeScript typings are included (No @types/ package needed)

Usage

import { parse, stringify, resolve } from '@stackmeister/uri'

const { scheme, userInfo, host, port, path, query, fragment } = parse(
  'https://example.com/some/path?query=test#someFragment'
)


const uri = stringify({ scheme, userInfo, host, port, path, query, fragment })

const fullUri = resolve('https://example.com', '/some/path')