# extend-url

> Splits a url into its parts and adds or replaces items found in the parts of another url.

Latest version **0.1.0** (published 2013-06-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install extend-url
pnpm add extend-url
yarn add extend-url
bun add extend-url
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2013-06-06 |
| First published | 2013-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Thorsten Lorenz |
| Maintainers | thlorenz |
| Keywords | extend, url, browser, query, auth, path, host |

## Links

- npm: https://www.npmjs.com/package/extend-url
- Repository: https://github.com/thlorenz/extend-url
- npm.io page: https://npm.io/package/extend-url

## Dependencies (1)

- [xtend](https://npm.io/package/xtend.md) ~2.0.5

## 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

- 0.1.0 (latest) — 2013-06-06

## README

# extend-url [![build status](https://secure.travis-ci.org/thlorenz/extend-url.png)](http://travis-ci.org/thlorenz/extend-url)

[![testling badge](https://ci.testling.com/thlorenz/extend-url.png)](https://ci.testling.com/thlorenz/extend-url)

Splits a url into its parts and adds or replaces items found in the parts of another url.

```js
var extendUrl = require('extend-url');

var url1 = 'https://joe:schmoe@api.github.com/users/thlorenz/repos?client_id=1&client_secret=2'
  , url2 = 'https://api.github.com/users/thlorenz/repos?page=1&per_page=10'
  , extended = extendUrl(url1, url2);

console.log(extended)
```

```
https://joe:schmoe@api.github.com/users/thlorenz/repos?client_id=1&client_secret=2&page=1&per_page=10
```

## Installation
    
    npm install extend-url

## API

### ***extendUrl(url1 : String, url2 : String) : String***

Returns a url that extends url1 with url2 as follows:

- **protocol** from url2
- **auth** from url2 or url1 whichever is found first
- **pathname** from url2
- **host** from url2
- **search** (query) url1's query extended with url2's query

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