jq

Sort a nested object by a key name

Get the data for the key .meetings:

$ jq '.meetings'

Move down to the context of '.meetings' without modifying data:

$ jq '{meetings: .meetings}'

Sort the keys .meetings.meetingname:

$ jq '{meetings: .meetings | sort_by(.meetingName)}'

strip quotes from output

Set raw output:

$ jq -r '.version' < './package.json'

Iterate over key-value pairs

$ jq -r '.dependencies|to_entries[] | .key + "@" + .value' < package.json

Delete value

$ jq 'del(.foo)' < package.json

results matching ""

    No results matching ""