url-join-ts
v1.0.5
Published
Join urls and normalize
Downloads
37,559
Maintainers
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¶m2=2
Licence
MIT