@jsonquerylang/jsonquery
Advanced tools
Comparing version 3.0.5 to 3.1.0
{ | ||
"name": "@jsonquerylang/jsonquery", | ||
"version": "3.0.5", | ||
"version": "3.1.0", | ||
"description": "A small, flexible, and expandable JSON query language", | ||
@@ -23,2 +23,5 @@ "keywords": [ | ||
}, | ||
"bin": { | ||
"jsonquery": "./bin/cli.js" | ||
}, | ||
"module": "./lib/jsonquery.js", | ||
@@ -25,0 +28,0 @@ "types": "./lib/jsonquery.d.ts", |
@@ -28,2 +28,3 @@ # JSON Query | ||
- [JavaScript API](#javascript-api) | ||
- [Command line interface (CLI)](#command-line-interface-cli) | ||
- [Gotchas](#gotchas) | ||
@@ -138,3 +139,3 @@ - [Development](#development) | ||
| [Array](#arrays) | `[ item1, item2, ... ]` | `[ "New York", "Atlanta" ]` | | ||
| [Property](#properties) | `.prop1`</br>`.prop1.prop2`</br>`."prop1"` | `.age`</br>`.address.city`</br>`."first name"` | | ||
| [Property](#properties) | `.prop1`<br/>`.prop1.prop2`<br/>`."prop1"` | `.age`<br/>`.address.city`<br/>`."first name"` | | ||
| [String](#values) | `"string"` | `"Hello world"` | | ||
@@ -300,5 +301,5 @@ | [Number](#values) | A floating point number | `2.4` | | ||
|---------|-------------------------------------------------------------------| | ||
| string | `"Hello world"`</br>`"Multi line text\nwith \"quoted\" contents"` | | ||
| number | `42`</br>`2.74`</br>`-1.2e3`</br> | | ||
| boolean | `true`</br>`false` | | ||
| string | `"Hello world"`<br/>`"Multi line text\nwith \"quoted\" contents"` | | ||
| number | `42`<br/>`2.74`<br/>`-1.2e3`<br/> | | ||
| boolean | `true`<br/>`false` | | ||
| null | `null` | | ||
@@ -317,3 +318,3 @@ | ||
| Array | `[ item1, item2, ... ]` | `["array", item1, item2, ... ]` | | ||
| Property | `.prop1`</br>`.prop1.prop2`</br>`."prop1"` | `["get", "prop1"]`</br>`["get", "prop1", "prop2"]`</br>`["get", "prop1"]` | | ||
| Property | `.prop1`<br/>`.prop1.prop2`<br/>`."prop1"` | `["get", "prop1"]`<br/>`["get", "prop1", "prop2"]`<br/>`["get", "prop1"]` | | ||
| String | `"string"` | `"string"` | | ||
@@ -573,2 +574,44 @@ | Number | A floating point number | A floating point number | | ||
## Command line interface (CLI) | ||
When `jsonquery` is installed globally using npm, it can be used on the command line. To install `jsonquery` globally: | ||
```bash | ||
$ npm install -g @jsonquerylang/jsonquery | ||
``` | ||
Usage: | ||
``` | ||
$ jsonquery [query] {OPTIONS} | ||
``` | ||
Options: | ||
``` | ||
--input Input file name | ||
--query Query file name | ||
--output Output file name | ||
--format Can be "text" (default) or "json" | ||
--indentation A string containing the desired indentation, | ||
like " " (default) or " " or "\t". An empty | ||
string will create output without indentation. | ||
--overwrite If true, output can overwrite an existing file | ||
--version, -v Show application version | ||
--help, -h Show this message | ||
``` | ||
Example usage: | ||
``` | ||
$ jsonquery --input users.json 'sort(.age)' | ||
$ jsonquery --input users.json 'filter(.city == "Rotterdam") | sort(.age)' | ||
$ jsonquery --input users.json 'sort(.age)' > output.json | ||
$ jsonquery --input users.json 'sort(.age)' --output output.json | ||
$ jsonquery --input users.json --query query.txt | ||
$ jsonquery --input users.json --query query.json --format json | ||
$ cat users.json | jsonquery 'sort(.age)' | ||
$ cat users.json | jsonquery 'sort(.age)' > output.json | ||
``` | ||
## Gotchas | ||
@@ -575,0 +618,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80736
22
564
657