# gron - JSON을 grep하기 좋게 만드는 도구

> Clean Markdown view of GeekNews topic #3159. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=3159](https://news.hada.io/topic?id=3159)
- GeekNews Markdown: [https://news.hada.io/topic/3159.md](https://news.hada.io/topic/3159.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2020-11-07T09:36:53+09:00
- Updated: 2020-11-07T09:36:53+09:00
- Original source: [github.com](https://github.com/tomnomnom/gron)
- Points: 13
- Comments: 0

## Topic Body

- JSON 데이터를 경로구조로 바꿔서 grep 했을때 위치를 쉽게 알 수 있음

- 추출한 경로구조 데이터만 다시 JSON으로 바꾸는 것도 지원

- 배열의 경우 인덱스도 표시

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

- Go 로 작성된 윈도우/맥/리눅스 바이너리. 의존성 없음.

## Comments



_No public comments on this page._
