# update-query

> Update the query string of a url with the given object

Latest version **1.0.5** (published 2017-03-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install update-query
pnpm add update-query
yarn add update-query
bun add update-query
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2017-03-21 |
| First published | 2016-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ken Berkeley |
| Maintainers | kenberkeley |
| Keywords | query, string, qs, update |

## Links

- npm: https://www.npmjs.com/package/update-query
- Repository: https://github.com/kenberkeley/update-query
- Homepage: https://github.com/kenberkeley/update-query#readme
- Issues: https://github.com/kenberkeley/update-query/issues
- npm.io page: https://npm.io/package/update-query

## Dependencies (2)

- [query-string](https://npm.io/package/query-string.md) ^4.2.3
- [object-assign](https://npm.io/package/object-assign.md) ^4.1.1

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2017-03-21
- 1.0.4 — 2016-12-28
- 1.0.3 — 2016-12-28
- 1.0.2 — 2016-12-28
- 1.0.1 — 2016-12-28
- 1.0.0 — 2016-12-27
- 0.1.1 — 2016-12-27
- 0.1.0 — 2016-12-27

## README

# updateQuery(url, Object)

[![npm version][npm-v-img]][npm-url]
[![npm download][npm-dl-img]][npm-url]
[![build][build-img]][build-url]

> Update the query string of a url with the given object

### Installation

`npm i update-query -S`  
> alternatively：`<script src="dist/update-query.min.js"></script>`

### Usage
> Any falsey value is omitted except `0`

```
> updateQuery('test.com?a=1', { b: 2 })
'test.com?a=1&b=2'

> updateQuery('test.com?a=1&b=2', { a: 0, b: 3 })
'test.com?a=0&b=3'

> updateQuery('test.com?a=1&b=2', { a: '', b: null })
'test.com'
```

### Build

`npm run build`, output will be piped into `dist/`


### Test & Coverage

`npm test` & `npm run cov`

[npm-url]: https://www.npmjs.com/package/update-query
[npm-v-img]: http://img.shields.io/npm/v/update-query.svg
[npm-dl-img]: http://img.shields.io/npm/dm/update-query.svg
[build-img]: https://travis-ci.org/kenberkeley/update-query.svg?branch=master
[build-url]: https://travis-ci.org/kenberkeley/update-query

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