Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jsonquerylang/jsonquery

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsonquerylang/jsonquery - npm Package Compare versions

Comparing version 3.0.5 to 3.1.0

bin/cli.js

5

package.json
{
"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",

53

README.md

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc