File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,31 @@ gron transforms JSON into discrete assignments to make it easier to `grep` for w
77It eases the exploration of APIs that return large blobs of JSON but have terrible documentation.
88
99<pre >
10- ▶ echo '{"is":{"hard":{"to":{"grep":{"gron":{"makes":{"it":"easy"}}}}}}}' | <b >gron</b > | grep easy
11- json.is.hard.to.grep.gron.makes.it = "<b >easy</b >";
10+ ▶ <b >gron</b > 'https://api.github.com/repos/tomnomnom/gron/commits?per_page=1' | fgrep 'commit.author'
11+ json[0].commit.author = {};
12+ json[0].commit.author.date = "2016-07-02T10:51:21Z";
13+ json[0].commit.author.email = "
[email protected] ";
14+ json[0].commit.author.name = "Tom Hudson";
1215</pre >
16+
17+ gron can work backwards too, enabling you to turn your filtered data back into JSON:
1318<pre >
14- ▶ echo 'it.works.backwards = "too!";' | <b >gron --ungron</b >
15- {
16- "it": {
17- "works": {
18- "backwards": "too!"
19+ ▶ gron 'https://api.github.com/repos/tomnomnom/gron/commits?per_page=1' | fgrep 'commit.author' | <b >gron --ungron</b >
20+ [
21+ {
22+ "commit": {
23+ "author": {
24+ "date": "2016-07-02T10:51:21Z",
25+ 26+ "name": "Tom Hudson"
27+ }
1928 }
2029 }
21- }
30+ ]
2231</pre >
2332
33+ > Disclaimer: the GitHub API documentation is fantastic, but it makes for a good example.
34+
2435## Installation
2536
2637gron has no runtime dependencies. You can just [ download a binary for Linux or Mac and run it] ( https://github.com/tomnomnom/gron/releases ) .
You can’t perform that action at this time.
0 commit comments