{"id":13517182,"url":"https://github.com/trentm/json","last_synced_at":"2025-05-13T23:04:18.404Z","repository":{"id":510183,"uuid":"1353110","full_name":"trentm/json","owner":"trentm","description":"A \"json\" command for massaging JSON on your Unix command line.","archived":false,"fork":false,"pushed_at":"2024-01-23T13:41:38.000Z","size":1060,"stargazers_count":1561,"open_issues_count":51,"forks_count":122,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-09T08:06:13.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://trentm.com/json","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trentm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null}},"created_at":"2011-02-11T00:35:08.000Z","updated_at":"2025-04-24T10:02:08.000Z","dependencies_parsed_at":"2023-07-05T15:01:36.935Z","dependency_job_id":"8cd40c4a-f3d0-4293-90cf-5522d8ec6678","html_url":"https://github.com/trentm/json","commit_stats":{"total_commits":346,"total_committers":15,"mean_commits":"23.066666666666666","dds":"0.052023121387283267","last_synced_commit":"a8baa02b5d6fc5f0c16521372ee89674a4706d82"},"previous_names":[],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trentm%2Fjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trentm%2Fjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trentm%2Fjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trentm%2Fjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trentm","download_url":"https://codeload.github.com/trentm/json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254040478,"owners_count":22004550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T05:01:30.799Z","updated_at":"2025-05-13T23:04:18.371Z","avatar_url":"https://github.com/trentm.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","\u003ca name=\"data-management-json\"\u003e\u003c/a\u003eData management - JSON/YAML/etc."],"sub_categories":[],"readme":"`json` is a fast CLI tool for working with JSON. It is a single-file node.js\nscript with no external deps (other than\n[node.js](https://github.com/joyent/node) itself). A quick taste:\n\n    $ echo '{\"foo\":\"bar\"}' | json\n    {\n      \"foo\": \"bar\"\n    }\n\n    $ echo '{\"foo\":\"bar\"}' | json foo\n    bar\n\n    $ echo '{\"fred\":{\"age\":42}}' | json fred.age    # '.' for property access\n    42\n\n    $ echo '{\"age\":10}' | json -e 'this.age++'\n    {\n      \"age\": 11\n    }\n\n    # `json -ga` (g == group, a == array) for streaming mode\n    $ echo '{\"latency\":32,\"req\":\"POST /widgets\"}\n    {\"latency\":10,\"req\":\"GET /ping\"}\n    ' | json -gac 'this.latency \u003e 10' req\n    POST /widgets\n\nFeatures:\n\n- pretty-printing JSON\n- natural syntax (like JS code) for extracting particular values\n- get details on JSON syntax errors (handy for config files)\n- filter input JSON (see `-e` and `-c` options)\n- fast stream processing (see `-ga`)\n- JSON validation\n- in-place file editing\n\nSee \u003chttps://trentm.com/json\u003e for full docs and examples as a man page.\n\nFollow \u003ca href=\"https://twitter.com/intent/user?screen_name=trentmick\" target=\"_blank\"\u003e@trentmick\u003c/a\u003e\nfor updates to json.\n\n\n# Installation\n\n1. Get [node](https://nodejs.org).\n\n2. `npm install -g json`\n\n   *Note: This used to be called 'jsontool' in the npm registry, but as of\n   version 8.0.0 it has taken over the 'json' name. See [npm Package\n   Name](#npm-package-name) below.*\n\n**OR manually**:\n\n2. Get the 'json' script and put it on your PATH somewhere (it is a single file\n   with no external dependencies). For example:\n\n        cd ~/bin\n        curl -L https://github.com/trentm/json/raw/master/lib/json.js \u003e json\n        chmod 755 json\n\nYou should now have \"json\" on your PATH:\n\n    $ json --version\n    json 9.0.0\n\n\n**WARNING for Ubuntu/Debian users:** There is a current bug in Debian stable\nsuch that \"apt-get install nodejs\" installed a `nodejs` binary instead of a\n`node` binary. You'll either need to create a symlink for `node`, change the\n`json` command's shebang line to \"#!/usr/bin/env nodejs\" or use\n[chrislea's PPA](https://launchpad.net/~chris-lea/+archive/node.js/) as\ndiscussed on [issue #56](https://github.com/trentm/json/issues/56). You can also do \"apt-get install nodejs-legacy\" to install symlink for `node` with apt.\n\n# Test suite\n\n    npm test   # or 'make test'\n\nThis is using node-tap, so you can use all [its options](https://node-tap.org/docs/cli/),\nfor example filtering which tests to run:\n\n    npm test -- -g stream\n\n\n# License\n\nMIT (see the fine LICENSE.txt file).\n\n\n# Module Usage\n\nSince v1.3.1 you can use \"json\" as a node.js module:\n\n    var json = require('json');\n\nHowever, so far the module API isn't that useful and the CLI is the primary\nfocus.\n\n\n# npm Package Name\n\nOnce upon a time, `json` was a different thing (see [zpoley's json-command\nhere](https://github.com/zpoley/json-command)), and this module was\ncalled `jsontool` in npm. As of version 8.0.0 of this module, `npm install json`\nmeans this tool.\n\nIf you see documentation referring to `jsontool`, it is most likely\nreferring to this module.\n\n\n# Alternatives you might prefer\n\n- jq: \u003chttps://stedolan.github.io/jq/\u003e\n- json:select: \u003chttps://jsonselect.org/\u003e\n- json-command: \u003chttps://github.com/zpoley/json-command\u003e\n- JSONPath: \u003chttps://goessner.net/articles/JsonPath/\u003e, \u003chttps://code.google.com/p/jsonpath/wiki/Javascript\u003e\n- jsawk: \u003chttps://github.com/micha/jsawk\u003e\n- jshon: \u003chttps://kmkeen.com/jshon/\u003e\n- json2: \u003chttps://github.com/vi/json2\u003e\n- fx: \u003chttps://github.com/antonmedv/fx\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrentm%2Fjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrentm%2Fjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrentm%2Fjson/lists"}