{"id":26126204,"url":"https://github.com/discoveryjs/jora-cli","last_synced_at":"2025-04-13T16:11:24.453Z","repository":{"id":35008851,"uuid":"195106490","full_name":"discoveryjs/jora-cli","owner":"discoveryjs","description":"Command line interface for jora (a JSON query language)","archived":false,"fork":false,"pushed_at":"2025-02-07T14:04:37.000Z","size":389,"stargazers_count":13,"open_issues_count":5,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-12T17:23:44.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/discoveryjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-03T18:19:19.000Z","updated_at":"2025-02-07T14:04:40.000Z","dependencies_parsed_at":"2024-10-23T01:02:04.189Z","dependency_job_id":null,"html_url":"https://github.com/discoveryjs/jora-cli","commit_stats":{"total_commits":54,"total_committers":3,"mean_commits":18.0,"dds":0.2407407407407407,"last_synced_commit":"e7b5c9df6aeb6d67f2f408d5e356be3f9234e791"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoveryjs%2Fjora-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoveryjs%2Fjora-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoveryjs%2Fjora-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoveryjs%2Fjora-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discoveryjs","download_url":"https://codeload.github.com/discoveryjs/jora-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741198,"owners_count":21154255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-10T17:28:04.288Z","updated_at":"2025-04-13T16:11:24.422Z","avatar_url":"https://github.com/discoveryjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jora-cli\n\n[![NPM version](https://img.shields.io/npm/v/jora-cli.svg)](https://www.npmjs.com/package/jora-cli)\n[![Build Status](https://github.com/discoveryjs/jora-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/discoveryjs/jora-cli/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/discoveryjs/jora-cli/badge.svg?branch=master)](https://coveralls.io/github/discoveryjs/jora-cli?)\n\nCommand line interface for [Jora](https://github.com/discoveryjs/jora) (a JSON query language)\n\n![jora-cli-demo](https://user-images.githubusercontent.com/270491/63531735-d4fd5980-c511-11e9-95ff-ed58dc94738a.gif)\n\n## Install\n\n```bash\nnpm i -g jora-cli\n```\n\n## Usage\n\n```bash\n\u003e jora -h\nUsage:\n\n    jora [query] [options]\n\nOptions:\n\n        --no-color               Suppress color output\n        --dry-run                Don't output result, only report what it would have done\n    -e, --encoding \u003cencoding\u003e    Output encoding: json (default), jsonxl (snapshot9)\n    -f, --force                  Force overwriting output file\n    -h, --help                   Output usage information\n    -i, --input \u003cfilename\u003e       Input file\n    -o, --output \u003cfilename\u003e      Output file (outputs to stdout if not set)\n    -p, --pretty [indent]        Pretty print with optionally specified indentation (4 spaces by default)\n    -q, --query \u003cquery\u003e          Jora query\n        --verbose                Output debug info about actions\n    -v, --version                Output version\n```\n\n## Examples\n\n- Get a single field from, e.g. \"version\":\n\n  ```bash\n  jora version \u003cpackage.json\n  ```\n\n- Get all top level dependencies count:\n\n  ```bash\n  jora -i package.json -q '(dependencies.keys() + devDependencies.keys()).size()'\n  ```\n\n- Find packages with more than a single version (run query from a file)\n\n  ```bash\n  npm ls --json | jora find-multi-version-packages.jora\n  ```\n\n  The content of `find-multi-version-packages.jora` may be as follows:\n\n  ```js\n  ..(dependencies.entries().({ name: key, ...value }))\n      .group(=\u003ename, =\u003eversion)\n      .({ name: key, versions: value })\n      .[versions.size() \u003e 1]\n  ```\n\n- `jora-cli` supports queries from JSONXl, and conversion between JSON and JSONXL. JSONXL is a binary replacement for JSON. It is supported by any app built on [Discovery.js](https://github.com/discoveryjs/discovery), including [JsonDiscovery](https://github.com/discoveryjs/JsonDiscovery), [CPUpro](https://github.com/discoveryjs/cpupro) and [Statoscope](https://github.com/statoscope/statoscope). JSONXL not only saves space and transfer time but also offers faster decoding and a lower memory footprint, which is beneficial for processing large datasets.\n    - Queries for JSONXL input work the same ways as for JSON:\n      ```bash\n      jora \u003cinput.jsonxl \"select.something\"\n      ```\n    - Convert JSON into JSONXL:\n      ```bash\n      jora \u003cinput.json \u003eoutput.jsonxl -e jsonxl\n      ```\n    - Convert JSONXL into JSON\n      ```\n      jora \u003cinput.jsonxl \u003eoutput.json\n      ```\n\n## Caveats\n\n`jora-cli` takes a valid JSON and produce a valid JSON as a result. However, `jora` language could produce some values that incompatable with JSON, such values are transforming:\n\n- `NaN`, `Infinity` and `-Infinity` are converting to `null`, that's a behaviour of `JSON.stringify()`\n- `undefined`\n  - is convering to `null` when a result of query (top level) or an element of an array\n  - object entries with `undefined` as a value are eliminating\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscoveryjs%2Fjora-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscoveryjs%2Fjora-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscoveryjs%2Fjora-cli/lists"}