# query-2-json

> convert a query string to a json structure

Latest version **1.2.4** (published 2019-10-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install query-2-json
pnpm add query-2-json
yarn add query-2-json
bun add query-2-json
```

## 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.2.4 |
| Published | 2019-10-30 |
| First published | 2019-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Aaron Lynn |
| Maintainers | gigaclank |
| Keywords | json, query, querybuilder |

## Links

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

## Dependencies (1)

- [mocha](https://npm.io/package/mocha.md) ^6.2.2

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.2.4 (latest) — 2019-10-30
- 1.2.3 — 2019-10-07
- 1.2.2 — 2019-10-07
- 1.2.1 — 2019-10-07
- 1.2.0 — 2019-10-07
- 1.1.1 — 2019-10-04
- 1.1.0 — 2019-10-04
- 1.0.2 — 2019-10-03
- 1.0.1 — 2019-10-03
- 1.0.0 — 2019-10-03

## README

# query-2-json
[![Build Status](https://travis-ci.com/Gigaclank/query-2-json.svg?branch=master)](https://travis-ci.com/Gigaclank/query-2-json)
[![npm version](https://badge.fury.io/js/query-2-json.svg)](https://badge.fury.io/js/query-2-json)
[![npm](https://img.shields.io/npm/dm/query-2-json.svg)]()

Inspired by [react-querybuilder](https://www.npmjs.com/package/react-querybuilder)

It is simple to use but would be easier to store the query string and convert it back to the json format from the string.

# Installation
``` bash
npm install query-2-json
```
# Usage
``` js
const q2j = require('query-2-json')

let q = "(a != 1 || (b == 2 && c <= 3)) && (d != 4)"

let json = q2j(q, { brackets: ['()'] });
console.log(JSON.stringify(json, null, 2))
let rule = q2j(json);
console.log(rule)
```
---
<p align="center" z-index = "-1">
  <img src="https://avatars2.githubusercontent.com/u/12459794?s=200&v=4"/>
</p>

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