diff --git a/README.md b/README.md index 9e9f97a..a3c59e6 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,39 @@ ## Install ```sh -npm i -D quri-js +npm i -D quri ``` +## QURI Spec + +More information about the QURI specification and parser is available [here](https://github.com/theHarvester/QURI). + ## Usage +Basic example + ```js -import quriJs from "quri-js" +import Criteria from "../src/index.js"; + +let criteria = new Criteria(); + +criteria.toString(); // "field_1".eq("my value") +``` + +Nested example + +```js +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); -quriJs() // true +criteria.toString(); +// "field_1".eq("outer"),("field_2".eq("nested%")|"field_3".in(1,2,3,4)) ``` ## License diff --git a/package.json b/package.json index 0b7db88..674689f 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "QURI", "query string" ], - "author": "theHarvester ", + "author": "James Harvey ", "license": "MIT", "bugs": { "url": "https://github.com/theHarvester/quri-js/issues"