Skip to content

Latest commit

 

History

History
65 lines (42 loc) · 1.68 KB

README.md

File metadata and controls

65 lines (42 loc) · 1.68 KB

quri-js

NPM version Build Status Coveralls Status Dependency Status Downloads

JS wrapper for the QURI string specification

Install

npm i -D quri

QURI Spec

More information about the QURI specification and parser is available here.

Usage

Basic example

import Criteria from "quri";

let criteria = new Criteria();

criteria.toString(); // "field_1".eq("my value")

Nested example

let criteria = new Criteria();
criteria.appendExpression('field_1', '==', 'outer');

let nestedCriteria = new Criteria('or');
nestedCriteria.appendExpression('field_2', 'like', 'nested%');
nestedCriteria.appendExpression('field_3', 'in', [1,2,3,4]);

criteria.appendCriteria(nestedCriteria);

criteria.toString();
// "field_1".eq("outer"),("field_2".eq("nested%")|"field_3".in(1,2,3,4))

License

MIT © theHarvester