TIL: gron

Retroactively published on 8 Mar 2019. A while ago I started keeping a journal of TILs, and I’ve decided to share some of them.

Today I learned about gron, a command-line utilty that makes it easy to search JSON data.

$ gron mydata.json | grep -i "big bird"
json.characters[0].name = "Big Bird";

It’s basically just printing each item in the object line-by-line.

$ gron mydata.json
json = {};
json.characters = [];
json.characters[0] = {};
json.characters[0].location = "Sesame Street";
json.characters[0].name = "Big Bird";
json.characters[1] = {};
json.characters[1].location = "Sesame Street";
json.characters[1].name = "Oscar the Grouch";

Super helpful, actually.

Installed with brew install gron.