# @xtuc/url-join

> Join urls and normalize as in path.join.

Latest version **1.1.0** (published 2017-04-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @xtuc/url-join
pnpm add @xtuc/url-join
yarn add @xtuc/url-join
bun add @xtuc/url-join
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-04-10 |
| First published | 2017-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 367 |
| Author | José F. Romaniello |
| Maintainers | xtuc |
| Keywords | url, join |

## Links

- npm: https://www.npmjs.com/package/@xtuc/url-join
- Repository: https://github.com/jfromaniello/url-join
- Homepage: https://github.com/jfromaniello/url-join#readme
- Issues: https://github.com/jfromaniello/url-join/issues
- npm.io page: https://npm.io/package/@xtuc/url-join

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2017-04-10
- 2.0.1 (next) — 2017-04-20
- 2.0.0 — 2017-04-12

## README

Join all arguments together and normalize the resulting url.

## Install

~~~
npm install url-join
~~~

## Usage

~~~javascript
var urljoin = require('url-join');

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

console.log(fullUrl);

~~~

Prints:

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

## Browser and AMD

It also works in the browser, you can either include ```lib/url-join.js``` in your page:

~~~html
<script src="url-join.js"></script>
<script type="text/javascript">
	urljoin('http://blabla.com', 'foo?a=1')
</script>
~~~

Or using an AMD module system like requirejs:

~~~javascript
define(['path/url-join.js'], function (urljoin) {
  urljoin('http://blabla.com', 'foo?a=1');
});
~~~

## License

MIT

---
_Source: https://npm.io/package/@xtuc/url-join · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
