url-join

Join urls and normalize as in path.join.

url-join downloads url-join version url-join license

url-joinSimilar Packages:
Npm Package Weekly Downloads Trend
3 Years
🌟 Show real-time usage chart on url-join's README.md, just copy the code below.
## Usage Trend
[![Usage Trend of url-join](https://npm-compare.com/img/npm-trend/THREE_YEARS/url-join.png)](https://npm-compare.com/url-join#timeRange=THREE_YEARS)
Cumulative GitHub Star Trend
🌟 Show GitHub stars trend chart on url-join's README.md, just copy the code below.
## GitHub Stars Trend
[![GitHub Stars Trend of url-join](https://npm-compare.com/img/github-trend/url-join.png)](https://npm-compare.com/url-join)
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
url-join11,551,9933654.74 kB6-MIT
README for url-join

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