Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

url-join-ts

kvandake25.9kMIT1.0.5TypeScript support: included

Join urls and normalize

typescript, url-join, url join, url

readme

url-join-ts

Join urls and normalize on Typescript.

Installation

npm i url-join-ts --save

or

yarn add url-join-ts

Usage

urlJoin(url, paths)

import { urlJoin } from 'url-join-ts';

urlJoin('https://example.com', 'path', 'path2');

// https://example.com/path/path2

urlJoinP(url, paths, params)

import { urlJoinP } from 'url-join-ts';

urlJoinP('https://example.com', ['path', 'path2'], {param1: 1, param2: '2'});

// https://example.com/path/path2?param1=1&param2=2

Licence

MIT