[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4909":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},4909,"gron","tomnomnom\u002Fgron","tomnomnom","Make JSON greppable!","",null,"Go",14452,332,86,42,0,3,8,32,10,42.57,"MIT License",false,"master",true,[27,28],"cli","json","2026-06-12 02:01:05","# gron\n[![Build Status](https:\u002F\u002Ftravis-ci.org\u002Ftomnomnom\u002Fgron.svg?branch=master)](https:\u002F\u002Ftravis-ci.org\u002Ftomnomnom\u002Fgron)\n\nMake JSON greppable!\n\ngron transforms JSON into discrete assignments to make it easier to `grep` for what you want and see the absolute 'path' to it.\nIt eases the exploration of APIs that return large blobs of JSON but have terrible documentation.\n\n\u003Cpre>\n▶ \u003Cb>gron\u003C\u002Fb> \"https:\u002F\u002Fapi.github.com\u002Frepos\u002Ftomnomnom\u002Fgron\u002Fcommits?per_page=1\" | fgrep \"commit.author\"\njson[0].commit.author = {};\njson[0].commit.author.date = \"2016-07-02T10:51:21Z\";\njson[0].commit.author.email = \"mail@tomnomnom.com\";\njson[0].commit.author.name = \"Tom Hudson\";\n\u003C\u002Fpre>\n\ngron can work backwards too, enabling you to turn your filtered data back into JSON:\n\u003Cpre>\n▶ gron \"https:\u002F\u002Fapi.github.com\u002Frepos\u002Ftomnomnom\u002Fgron\u002Fcommits?per_page=1\" | fgrep \"commit.author\" | \u003Cb>gron --ungron\u003C\u002Fb>\n[\n  {\n    \"commit\": {\n      \"author\": {\n        \"date\": \"2016-07-02T10:51:21Z\",\n        \"email\": \"mail@tomnomnom.com\",\n        \"name\": \"Tom Hudson\"\n      }\n    }\n  }\n]\n\u003C\u002Fpre>\n\n> Disclaimer: the GitHub API has fantastic documentation, but it makes for a good example.\n\n## Installation\n\ngron has no runtime dependencies. You can just [download a binary for Linux, Mac, Windows or FreeBSD and run it](https:\u002F\u002Fgithub.com\u002Ftomnomnom\u002Fgron\u002Freleases).\nPut the binary in your `$PATH` (e.g. in `\u002Fusr\u002Flocal\u002Fbin`) to make it easy to use:\n```\n▶ tar xzf gron-linux-amd64-0.1.5.tgz\n▶ sudo mv gron \u002Fusr\u002Flocal\u002Fbin\u002F\n```\n\nIf you're a Mac user you can also [install gron via brew](http:\u002F\u002Fbraumeister.org\u002Fformula\u002Fgron):\n```\n▶ brew install gron\n```\n\nOr if you're a Go user you can use `go install`:\n\n```\n▶ go install github.com\u002Ftomnomnom\u002Fgron@latest\n```\n\nIt's recommended that you alias `ungron` or `norg` (or both!) to `gron --ungron`. Put something like this in your shell profile (e.g. in `~\u002F.bashrc`):\n```\nalias norg=\"gron --ungron\"\nalias ungron=\"gron --ungron\"\n```\nOr you could create a shell script in your $PATH named `ungron` or `norg` to affect all users:\n```\ngron --ungron \"$@\"\n```\n\n## Usage\n\nGet JSON from a file:\n\n```\n▶ gron testdata\u002Ftwo.json \njson = {};\njson.contact = {};\njson.contact.email = \"mail@tomnomnom.com\";\njson.contact.twitter = \"@TomNomNom\";\njson.github = \"https:\u002F\u002Fgithub.com\u002Ftomnomnom\u002F\";\njson.likes = [];\njson.likes[0] = \"code\";\njson.likes[1] = \"cheese\";\njson.likes[2] = \"meat\";\njson.name = \"Tom\";\n```\n\nFrom a URL:\n\n```\n▶ gron http:\u002F\u002Fheaders.jsontest.com\u002F\njson = {};\njson.Host = \"headers.jsontest.com\";\njson[\"User-Agent\"] = \"gron\u002F0.1\";\njson[\"X-Cloud-Trace-Context\"] = \"6917a823919477919dbc1523584ba25d\u002F11970839830843610056\";\n```\n\nOr from `stdin`:\n\n```\n▶ curl -s http:\u002F\u002Fheaders.jsontest.com\u002F | gron\njson = {};\njson.Accept = \"*\u002F*\";\njson.Host = \"headers.jsontest.com\";\njson[\"User-Agent\"] = \"curl\u002F7.43.0\";\njson[\"X-Cloud-Trace-Context\"] = \"c70f7bf26661c67d0b9f2cde6f295319\u002F13941186890243645147\";\n```\n\nGrep for something and easily see the path to it:\n\n```\n▶ gron testdata\u002Ftwo.json | grep twitter\njson.contact.twitter = \"@TomNomNom\";\n```\n\ngron makes diffing JSON easy too:\n\n```\n▶ diff \u003C(gron two.json) \u003C(gron two-b.json)\n3c3\n\u003C json.contact.email = \"mail@tomnomnom.com\";\n---\n> json.contact.email = \"contact@tomnomnom.com\";\n```\n\nThe output of `gron` is valid JavaScript:\n\n```\n▶ gron testdata\u002Ftwo.json > tmp.js\n▶ echo \"console.log(json);\" >> tmp.js\n▶ nodejs tmp.js\n{ contact: { email: 'mail@tomnomnom.com', twitter: '@TomNomNom' },\n  github: 'https:\u002F\u002Fgithub.com\u002Ftomnomnom\u002F',\n  likes: [ 'code', 'cheese', 'meat' ],\n  name: 'Tom' }\n```\n\nIt's also possible to obtain the `gron` output as JSON stream via\nthe `--json` switch:\n\n```\n▶ curl -s http:\u002F\u002Fheaders.jsontest.com\u002F | gron --json\n[[],{}]\n[[\"Accept\"],\"*\u002F*\"]\n[[\"Host\"],\"headers.jsontest.com\"]\n[[\"User-Agent\"],\"curl\u002F7.43.0\"]\n[[\"X-Cloud-Trace-Context\"],\"c70f7bf26661c67d0b9f2cde6f295319\u002F13941186890243645147\"]\n```\n\n## ungronning\ngron can also turn its output back into JSON:\n```\n▶ gron testdata\u002Ftwo.json | gron -u\n{\n  \"contact\": {\n    \"email\": \"mail@tomnomnom.com\",\n    \"twitter\": \"@TomNomNom\"\n  },\n  \"github\": \"https:\u002F\u002Fgithub.com\u002Ftomnomnom\u002F\",\n  \"likes\": [\n    \"code\",\n    \"cheese\",\n    \"meat\"\n  ],\n  \"name\": \"Tom\"\n}\n```\n\nThis means you use can use gron with `grep` and other tools to modify JSON:\n```\n▶ gron testdata\u002Ftwo.json | grep likes | gron --ungron\n{\n  \"likes\": [\n    \"code\",\n    \"cheese\",\n    \"meat\"\n  ]\n}\n```\n\nor\n\n\n```\n▶ gron --json testdata\u002Ftwo.json | grep likes | gron  --json --ungron\n{\n  \"likes\": [\n    \"code\",\n    \"cheese\",\n    \"meat\"\n  ]\n}\n```\n\nTo preserve array keys, arrays are padded with `null` when values are missing:\n```\n▶ gron testdata\u002Ftwo.json | grep likes | grep -v cheese\njson.likes = [];\njson.likes[0] = \"code\";\njson.likes[2] = \"meat\";\n▶ gron testdata\u002Ftwo.json | grep likes | grep -v cheese | gron --ungron\n{\n  \"likes\": [\n    \"code\",\n    null,\n    \"meat\"\n  ]\n}\n```\n\nIf you get creative you can do [some pretty neat tricks with gron](ADVANCED.mkd), and\nthen ungron the output back into JSON.\n\n## Get Help\n\n```\n▶ gron --help\nTransform JSON (from a file, URL, or stdin) into discrete assignments to make it greppable\n\nUsage:\n  gron [OPTIONS] [FILE|URL|-]\n\nOptions:\n  -u, --ungron     Reverse the operation (turn assignments back into JSON)\n  -v, --values     Print just the values of provided assignments\n  -c, --colorize   Colorize output (default on tty)\n  -m, --monochrome Monochrome (don't colorize output)\n  -s, --stream     Treat each line of input as a separate JSON object\n  -k, --insecure   Disable certificate validation\n  -j, --json       Represent gron data as JSON stream\n      --no-sort    Don't sort output (faster)\n      --version    Print version information\n\nExit Codes:\n  0\tOK\n  1\tFailed to open file\n  2\tFailed to read input\n  3\tFailed to form statements\n  4\tFailed to fetch URL\n  5\tFailed to parse statements\n  6\tFailed to encode JSON\n\nExamples:\n  gron \u002Ftmp\u002Fapiresponse.json\n  gron http:\u002F\u002Fjsonplaceholder.typicode.com\u002Fusers\u002F1 \n  curl -s http:\u002F\u002Fjsonplaceholder.typicode.com\u002Fusers\u002F1 | gron\n  gron http:\u002F\u002Fjsonplaceholder.typicode.com\u002Fusers\u002F1 | grep company | gron --ungron\n```\n\n## FAQ\n### Wasn't this written in PHP before?\nYes it was! The original version is [preserved here for posterity](https:\u002F\u002Fgithub.com\u002Ftomnomnom\u002Fgron\u002Fblob\u002Fmaster\u002Foriginal-gron.php).\n\n### Why the change to Go?\nMostly to remove PHP as a dependency. There's a lot of people who work with JSON who don't have PHP installed.\n\n### Why shouldn't I just use jq?\n[jq](https:\u002F\u002Fstedolan.github.io\u002Fjq\u002F) is *awesome*, and a lot more powerful than gron, but with that power comes\ncomplexity. gron aims to make it easier to use the tools you already know, like `grep` and `sed`.\n\ngron's primary purpose is to make it easy to find the path to a value in a deeply nested JSON blob\nwhen you don't already know the structure; much of jq's power is unlocked only once you know that structure.\n","gron 是一个用于将 JSON 数据转换为易于搜索格式的命令行工具。它通过将 JSON 转换为一系列独立的赋值语句，使得用户可以方便地使用 `grep` 等文本处理工具来查找特定信息，并清晰地看到数据路径，特别适用于探索那些返回大量 JSON 数据但文档不完善的 API 场景。此外，gron 还支持反向操作，即从过滤后的数据重新生成 JSON 格式。该工具采用 Go 语言编写，具有跨平台特性，无需额外依赖即可运行。",2,"2026-06-11 03:01:25","top_language"]