All Projects → blgm → jfq

blgm / jfq

Licence: MIT license
JSONata on the command line

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jfq

ycat
Command line processor for YAML/JSON files using Jsonnet
Stars: ✭ 21 (-27.59%)
Mutual labels:  jq
SciFi Conky HUD
SciFi theme for Conky
Stars: ✭ 33 (+13.79%)
Mutual labels:  jq
ghrecipes
⛔ ARCHIVED ⛔ Provides some helper functions for using the GitHub V4 API
Stars: ✭ 28 (-3.45%)
Mutual labels:  jq
jqjs
Pure-JavaScript implementation of the jq JSON query language
Stars: ✭ 39 (+34.48%)
Mutual labels:  jq
jq-zsh-plugin
jq zsh plugin
Stars: ✭ 155 (+434.48%)
Mutual labels:  jq
biowasm
WebAssembly modules for genomics
Stars: ✭ 115 (+296.55%)
Mutual labels:  jq
jq-tutorial
Interactive exercises for learning jq
Stars: ✭ 109 (+275.86%)
Mutual labels:  jq
jqmd
Write and document your jq/shell scripts with markdown
Stars: ✭ 24 (-17.24%)
Mutual labels:  jq
pjs
An awk-like command-line tool for processing text, CSV, JSON, HTML, and XML.
Stars: ✭ 21 (-27.59%)
Mutual labels:  jq
cheatsheets
My Cheatsheet Repository
Stars: ✭ 193 (+565.52%)
Mutual labels:  jq
wildq
Command-line TOML/JSON/INI/YAML/XML/HCL processor using jq c bindings
Stars: ✭ 22 (-24.14%)
Mutual labels:  jq
ijq
Interactive jq (mirror)
Stars: ✭ 100 (+244.83%)
Mutual labels:  jq
gosquito
gosquito ("go" + "mosquito") is a pluggable tool for data gathering, data processing and data transmitting to various destinations.
Stars: ✭ 25 (-13.79%)
Mutual labels:  jq
json to paths
Distill a JSON document into a collection of paths both for 'jq' and 'xpath'
Stars: ✭ 65 (+124.14%)
Mutual labels:  jq
api-test
🌿 A simple bash script to test JSON API from terminal in a structured and organized way.
Stars: ✭ 53 (+82.76%)
Mutual labels:  jq
jsqry-cli2
Small CLI tool (similar to jq) to query JSON using sane DSL
Stars: ✭ 21 (-27.59%)
Mutual labels:  jq
atom-jq
[unmantained] A playground for jq inside atom
Stars: ✭ 22 (-24.14%)
Mutual labels:  jq
sjq
Command-line JSON processor with Scala syntax
Stars: ✭ 54 (+86.21%)
Mutual labels:  jq
onymous-plurk
Anonymous Plurk Cross-matching Tool - Plurk偷偷說交叉比對工具
Stars: ✭ 20 (-31.03%)
Mutual labels:  jq
vscode-jq
jq LiveView Extension for VS Code
Stars: ✭ 15 (-48.28%)
Mutual labels:  jq

npm test

jfq

JSONata on the command line.

This was inspired by the excellent jq utility, and uses JSONata rather than the jq language.

Installation

npm install --global jfq

Usage

jfq [options] [<JSONata query>] [<files>]

It is good practice to put the JSONata query in single quotes, so that the shell does not attempt to interpret it.

The output will formatted as JSON, unless it's an array of simple objects (e.g. string, number) when the output is flattened to a series of lines, so that it can be piped to another program such as xargs.

Options

  • -n, --ndjson output as newline-delimited JSON (each object on a single line)
  • -j, --json force output as JSON, when it would normally be flattened
  • -y, --yaml output as YAML
  • -a, --accept-yaml accept YAML input
  • -q, --query-file <path> read JSONata query from a file

Examples

  • To read the version of JSONata from the file package.json:
jfq 'dependencies.jsonata' package.json

# ^1.5.0
  • To find out how many downloads of JSONata there have been each month in the past year:
curl -s \
  https://api.npmjs.org/downloads/range/last-year/jsonata \
  | jfq 'downloads{$substring(day, 0, 7): $sum(downloads)}'

# {
#  "2017-02": 36216,
#  "2017-03": 46460,
#  "2017-04": 40336,
#  ...
# }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].