query-2-json

1.2.4 • Public • Published

query-2-json

Build Status npm version npm

Inspired by 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

npm install query-2-json

Usage

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)

Readme

Keywords

Package Sidebar

Install

npm i query-2-json

Weekly Downloads

0

Version

1.2.4

License

MIT

Unpacked Size

16.1 kB

Total Files

12

Last publish

Collaborators

  • gigaclank