JSON

Valida, formatta, comprime e interroga file JSON: cjson file.json, cjson -c file.json (compatto), cjson -q .foo.bar file.json (estrai un valore), cjson -l file.jsonl (un valore per riga).

versione 1.7.19 · Licenza: MIT · Sito del progetto

JSON

A cosa serve

Controlla se un file JSON è valido, lo formatta in modo leggibile, lo comprime su una riga o ne estrae un singolo valore. Comodo per ispezionare configurazioni, risposte di API e log.

Come si usa

Comando Cosa fa
cjson file.json valida e stampa indentato
cjson -c file.json stampa compatto, su una riga
cjson -q .utente.nome file.json estrae il valore a quel percorso
cjson -q .elenco.0 file.json primo elemento di un array
cjson -l file.jsonl un valore JSON per riga (JSON Lines)
cjson legge dall'input: incolla il JSON, poi EOF

Se il file non è valido, cjson lo segnala con un errore.

Nel Terminale

JSON

Validate, pretty-print, minify and query JSON files: cjson file.json, cjson -c file.json (compact), cjson -q .foo.bar file.json (pick a value), cjson -l file.jsonl (one value per line).

version 1.7.19 · License: MIT · Project site

JSON

What it is

Checks whether a JSON file is valid, pretty-prints it, compacts it onto one line or pulls out a single value. Handy for inspecting configs, API replies and logs.

How to use it

Command What it does
cjson file.json validates and pretty-prints
cjson -c file.json prints compact, on one line
cjson -q .user.name file.json extracts the value at that path
cjson -q .list.0 file.json first element of an array
cjson -l file.jsonl one JSON value per line (JSON Lines)
cjson reads input: paste the JSON, then EOF

If the file is invalid, cjson reports an error.

In the Terminal