url-join-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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

Package Sidebar

Install

npm i url-join-ts

Weekly Downloads

7,191

Version

1.0.5

License

MIT

Unpacked Size

175 kB

Total Files

20

Last publish

Collaborators

  • kvandake