jsawk

Process JSON data using JavaScript expressions like awk

brewmacoslinux
Try with needOr install directly
Source

About

Like awk, but for JSON, using JavaScript objects and arrays

Commands

jsawk

Examples

Extract a specific field from JSON objects in an array$ echo '[{"name":"Alice","age":30},{"name":"Bob","age":25}]' | jsawk 'this.name'
Filter JSON array elements based on a condition$ cat data.json | jsawk 'if(this.age > 25) this'
Transform JSON objects by creating new fields$ echo '{"first":"John","last":"Doe"}' | jsawk 'this.full = this.first + " " + this.last; this'