# query-parse

> Parse query strings to objects and objects to strings. Hides null or empty values.

Latest version **2.0.0** (published 2017-09-06) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.0.0 |
| Published | 2017-09-06 |
| First published | 2013-07-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Scott Corgan |
| Maintainers | scottcorgan |
| Keywords | query, string, parser, params, parameters |

## Links

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

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Recent versions

- 2.0.0 (latest) — 2017-09-06
- 1.0.0 — 2017-01-20
- 0.1.1 — 2013-12-03
- 0.1.0 — 2013-07-09

## README

# query-parse

Parse query strings to objects and objects to strings.

USEFUL: Removes null or empty values. It also sorts the params alphabetically, so you will always get the same string for the same params.

## Install

[![NPM](https://nodei.co/npm/query-parse.png)](https://nodei.co/npm/query-parse/)

## Usage

```javascript
var qp = require('query-parse');

var paramStr = qp.toString({
  param1: 'foo',
  param2: 'bar';
});

// Outputs: "param1=foo&param2=bar";

var paramObj = qp.toObject('param1=foo&param2=bar&param3=');

// Outputs:
//  {
//    param1: 'foo',
//    param2: 'bar'
//  }
//
// Ignores blank parameters for both toString and toObject

```

## Test

```
npm test
```

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