13 Punkte von xguru 2020-11-07 | Noch keine Kommentare. | Auf WhatsApp teilen
  • Wandelt JSON-Daten in eine Pfadstruktur um, sodass man beim grepen die Position leicht erkennen kann

  • Unterstützt auch, die extrahierten Pfadstrukturdaten wieder in JSON zurückzuverwandeln

  • Bei Arrays werden auch die Indizes angezeigt

▶ gron "https://api.github.com/repos/tomnomnom/gron/commits?per_page=1"; | fgrep "commit.author"

json[0].commit.author = {};

json[0].commit.author.date = "2016-07-02T10:51:21Z";

json[0].commit.author.email = "mail@tomnomnom.com";

json[0].commit.author.name = "Tom Hudson";

▶ gron "https://api.github.com/repos/tomnomnom/gron/commits?per_page=1"; | fgrep "commit.author" | gron --ungron

[

{

"commit": {

"author": {

"date": "2016-07-02T10:51:21Z",

"email": "mail@tomnomnom.com",

"name": "Tom Hudson"

}

}

}

]

▶ gron testdata/two.json

json = {};

json.contact = {};

json.contact.email = "mail@tomnomnom.com";

json.contact.twitter = "@TomNomNom";

json.github = "https://github.com/tomnomnom/";;

json.likes = [];

json.likes[0] = "code";

json.likes[1] = "cheese";

json.likes[2] = "meat";

json.name = "Tom";

  • Ein in Go geschriebenes Binary für Windows/Mac/Linux. Keine Abhängigkeiten.

Noch keine Kommentare.

Noch keine Kommentare.