Skip to content

Comment on Show HN: Flatito, grep for YAML and JSON files

Comments

related project, gron: https://github.com/tomnomnom/gron

    ▶ 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";

Looks neat, but what happens if a JSON key has a value like "foo.bar" or "foo[0]", etc. Does the textual response escape them?

Yes:

    json = {};
    json["foo.bar"] = true;
    json["foo[0]"] = true;
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.