npm.io
5.0.0 • Published 4 years ago

url-join

Licence
MIT
Version
5.0.0
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
366

Join all arguments together and normalize the resulting URL.

Install

npm install url-join

If you want to use it directly in a browser use a CDN like Skypack.

Usage

import urlJoin from 'url-join';

const fullUrl = urlJoin('http://www.google.com', 'a', '/b/cd', '?foo=123');

console.log(fullUrl);

Prints:

'http://www.google.com/a/b/cd?foo=123'

License

MIT