jq

    jq command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.2.10
    License
    Apache-2.0
    Last updated
    8 hours ago
    Downloads
    211

    #jq

    Filter and transform JSON through MoonX.

    #Usage

    printf '%s' '{"name":"Moon"}' | moonx cli/jq -r '.name' moonx cli/jq -n -c '{ok: true, values: [1, 2]}' moonx cli/jq -c '.items[]' input.json

    Read consecutive JSON values from files or stdin. The default filter is identity; raw, slurp, stream, variables, functions and module loading are supported.

    #Common options

    OptionDescription
    -c, --compact-outputprint compact JSON
    -n, --null-inputevaluate once with null; input/inputs can still read
    -s, --slurpcollect input values in an array
    -r, --raw-outputprint strings without JSON quotes
    -R, --raw-inputread text lines; -Rs reads all text
    -e, --exit-statusreturn 1 for false/null, 4 for no result
    -f, --from-fileread the first positional argument as a filter file
    --helpShow help.
    --versionShow the version.

    Use --help for the complete option list.

    #Notes

    • Use -f with a positional filter filename. --arg NAME VALUE and --argjson NAME JSON each consume two arguments.
    • The implemented language is a subset of jq; exact numeric ordering at or above 2^53 and complete upstream diagnostics are not claimed. Invalid later input may follow already-written results.
    • Color requires -C. -l/--logs skips invalid JSON lines. The value-filter engine is also available as cli/jq/engine.

    See the compatibility guide for the supported profile.

    Source Files