{"id":51133665,"url":"https://github.com/trananhtung/gron-rs","last_synced_at":"2026-06-27T17:00:31.187Z","repository":{"id":366610720,"uuid":"1275940585","full_name":"trananhtung/gron-rs","owner":"trananhtung","description":"Make JSON greppable: flatten JSON to assignment lines and back (a Rust gron/ungron), library + CLI.","archived":false,"fork":false,"pushed_at":"2026-06-22T14:46:19.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-22T16:16:46.943Z","etag":null,"topics":["cli","flatten","grep","gron","jq","json","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trananhtung.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-21T10:39:24.000Z","updated_at":"2026-06-22T14:47:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/trananhtung/gron-rs","commit_stats":null,"previous_names":["trananhtung/gron-rs"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/trananhtung/gron-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Fgron-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Fgron-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Fgron-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Fgron-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trananhtung","download_url":"https://codeload.github.com/trananhtung/gron-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Fgron-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34780126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","flatten","grep","gron","jq","json","rust"],"created_at":"2026-06-25T15:01:44.676Z","updated_at":"2026-06-25T15:01:45.846Z","avatar_url":"https://github.com/trananhtung.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gron-rs\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\n[![Crates.io](https://img.shields.io/crates/v/gron-rs.svg)](https://crates.io/crates/gron-rs)\n[![Documentation](https://docs.rs/gron-rs/badge.svg)](https://docs.rs/gron-rs)\n[![CI](https://github.com/trananhtung/gron-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/trananhtung/gron-rs/actions/workflows/ci.yml)\n[![License](https://img.shields.io/crates/l/gron-rs.svg)](#license)\n\n**Make JSON greppable.** Flatten a JSON document into discrete assignment lines\nyou can `grep`, `diff`, and `sed` — then turn them back into JSON. A Rust port of\n[gron](https://github.com/tomnomnom/gron), available as both a **library** and a\n`gron` **CLI**.\n\n```text\n$ echo '{\"user\":{\"name\":\"Tom\",\"tags\":[\"a\",\"b\"]}}' | gron\njson = {};\njson.user = {};\njson.user.name = \"Tom\";\njson.user.tags = [];\njson.user.tags[0] = \"a\";\njson.user.tags[1] = \"b\";\n\n$ echo '{\"user\":{\"name\":\"Tom\"}}' | gron | grep name\njson.user.name = \"Tom\";\n\n$ gron file.json | grep '\\.user' | gron --ungron   # filter, then rebuild JSON\n```\n\n## Why gron-rs?\n\n`gron` makes deeply-nested JSON diffable and greppable — but Rust's existing gron\ncrates are all stale (2017–2022), one-way, or CLI-only with **no library API**.\n`gron-rs` is a maintained, round-trip (`gron` + `ungron`) implementation you can\nuse both ways.\n\n## Library\n\n```toml\n[dependencies]\ngron-rs = \"0.1\"\n```\n\n```rust\nuse serde_json::json;\n\nlet v = json!({ \"name\": \"Tom\", \"tags\": [\"a\", \"b\"] });\nlet lines = gron::gron(\u0026v);                  // flatten\nlet back = gron::ungron(\u0026lines).unwrap();    // reconstruct\nassert_eq!(back, v);\n```\n\n| Function | Purpose |\n| --- | --- |\n| `gron(\u0026Value) -\u003e String` | Flatten to assignment lines (root `json`) |\n| `gron_with_root(\u0026Value, root) -\u003e String` | Flatten with a custom root identifier |\n| `ungron(\u0026str) -\u003e Result\u003cValue, UngronError\u003e` | Reconstruct JSON from gron lines |\n\n## CLI\n\n```sh\ncargo install gron-rs        # installs the `gron` binary\n\ngron file.json               # flatten (or pipe via stdin)\ngron -u                      # --ungron: reconstruct JSON from stdin\ngron --root data file.json   # custom root identifier\n```\n\n## Behavior\n\n- Object keys that are valid identifiers use `.key`; others are `[\"quoted\"]`.\n- Output is in structural order (objects by sorted key, arrays by index) —\n  stable and diff-friendly.\n- `ungron` reconstructs containers even if the empty-container lines are missing\n  (inferred from the paths), and round-trips any `gron` output exactly.\n\n## Contributors ✨\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the [emoji key](https://allcontributors.org/docs/en/emoji-key) for how each contribution is recognized, and open a PR or issue to get involved.\n\nThanks goes to these wonderful people:\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/trananhtung\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/30992229?v=4?s=100\" width=\"100px;\" alt=\"Tung Tran\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTung Tran\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/trananhtung/gron-rs/commits?author=trananhtung\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#maintenance-trananhtung\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## License\n\nLicensed under either of [Apache-2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT) at\nyour option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrananhtung%2Fgron-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrananhtung%2Fgron-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrananhtung%2Fgron-rs/lists"}