{"id":13413260,"url":"https://github.com/yazgazan/jaydiff","last_synced_at":"2026-04-02T20:29:50.034Z","repository":{"id":51059178,"uuid":"89260819","full_name":"yazgazan/jaydiff","owner":"yazgazan","description":"A JSON diff utility","archived":false,"fork":false,"pushed_at":"2024-03-05T12:01:03.000Z","size":172,"stargazers_count":105,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T23:04:00.499Z","etag":null,"topics":["cli","diff","golang","json"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yazgazan.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2017-04-24T16:05:35.000Z","updated_at":"2024-12-20T12:24:54.000Z","dependencies_parsed_at":"2024-06-18T15:29:50.636Z","dependency_job_id":"6ad0dfa3-9be3-4ac9-abc3-6a8618a9db2f","html_url":"https://github.com/yazgazan/jaydiff","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yazgazan%2Fjaydiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yazgazan%2Fjaydiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yazgazan%2Fjaydiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yazgazan%2Fjaydiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yazgazan","download_url":"https://codeload.github.com/yazgazan/jaydiff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635295,"owners_count":20322912,"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":["cli","diff","golang","json"],"created_at":"2024-07-30T20:01:36.318Z","updated_at":"2026-04-02T20:29:45.002Z","avatar_url":"https://github.com/yazgazan.png","language":"Go","readme":"# JayDiff\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/yazgazan/jaydiff)](https://goreportcard.com/report/github.com/yazgazan/jaydiff)\n[![GoDoc](https://godoc.org/github.com/yazgazan/jaydiff?status.svg)](https://godoc.org/github.com/yazgazan/jaydiff)\n[![Build Status](https://travis-ci.org/yazgazan/jaydiff.svg?branch=master)](https://travis-ci.org/yazgazan/jaydiff)\n[![Coverage Status](https://coveralls.io/repos/github/yazgazan/jaydiff/badge.svg?branch=master)](https://coveralls.io/github/yazgazan/jaydiff?branch=master)\n[![Maintainability](https://api.codeclimate.com/v1/badges/c6114df1683db0db4fe4/maintainability)](https://codeclimate.com/github/yazgazan/jaydiff/maintainability)\n\nA JSON diff utility.\n\n## Install\n\n### Downloading the compiled binary\n\n- Download the latest version of the binary: [releases](https://github.com/yazgazan/jaydiff/releases)\n- extract the archive and place the `jaydiff` binary in your `$PATH`\n\n### From source\n\n- Have go 1.11 or greater installed: [golang.org](https://golang.org/doc/install)\n- run `go get -u github.com/yazgazan/jaydiff`\n\n## Usage\n\n```text\nUsage:\n  jaydiff [OPTIONS] FILE_1 FILE_2\n\nApplication Options:\n  -i, --ignore=               paths to ignore (glob)\n      --indent=               indent string (default: \"\\t\")\n  -t, --show-types            show types\n      --json                  json-style output\n      --ignore-excess         ignore excess keys and array elements\n      --ignore-values         ignore scalar's values (only type is compared)\n  -r, --report                output report format\n      --slice-myers           use myers algorithm for slices\n      --stream                treat FILE_1 and FILE_2 as JSON streams\n      --stream-lines          read JSON stream line by line (expecting 1 JSON value per line)\n      --stream-ignore-excess  ignore excess values in JSON stream\n      --stream-validate       compare FILE_2 JSON stream against FILE_1 single value\n  -v, --version               print release version\n\nHelp Options:\n  -h, --help                  Show this help message\n```\n\n### Examples\n\nGetting a full diff of two json files:\n\n```diff\n$ jaydiff --show-types old.json new.json\n\n map[string]interface {} map[\n     a: float64 42\n     b: []interface {} [\n         float64 1\n-        float64 3\n+        float64 5\n+        float64 4\n     ]\n     c: map[string]interface {} map[\n-        a: string toto\n+        a: string titi\n-        b: float64 23\n+        b: string 23\n     ]\n-    e: []interface {} []\n-    f: float64 42\n     g: []interface {} [1 2 3]\n+    h: float64 42\n ]\n```\n\nIgnoring fields:\n\n```diff\n$ jaydiff --show-types \\\n    --ignore='.b\\[\\]' --ignore='.d' --ignore='.c.[ac]' \\\n      old.json new.json\n\n map[string]interface {} map[\n     a: float64 42\n     b: []interface {} [1 3]\n     c: map[string]interface {} map[\n-        b: float64 23\n+        b: string 23\n     ]\n-    e: []interface {} []\n-    f: float64 42\n     g: []interface {} [1 2 3]\n+    h: float64 42\n ]\n```\n\nReport format:\n\n```diff\n$ jaydiff --report --show-types old.json new.json\n\n- .b[1]: float64 3\n+ .b[1]: float64 5\n+ .b[2]: float64 4\n- .c.a: string toto\n+ .c.a: string titi\n- .c.b: float64 23\n+ .c.b: string 23\n- .e: []interface {} []\n- .f: float64 42\n+ .h: float64 42\n```\n\nJSON-like format:\n\n```diff\n$ jaydiff --json old.json new.json\n\n {\n     \"a\": 42,\n     \"b\": [\n         1,\n-        3,\n+        5,\n+        4\n     ],\n     \"c\": {\n-        \"a\": \"toto\",\n+        \"a\": \"titi\",\n-        \"b\": 23,\n+        \"b\": \"23\"\n     },\n-    \"e\": [],\n-    \"f\": 42,\n     \"g\": [1,2,3],\n+    \"h\": 42\n }\n```\n\nIgnore Excess values (useful when checking for backward compatibility):\n\n```diff\n$ jaydiff --report --show-types --ignore-excess old.json new.json\n\n- .b[1]: float64 3\n+ .b[1]: float64 5\n- .c.a: string toto\n+ .c.a: string titi\n- .c.b: float64 23\n+ .c.b: string 23\n- .e: []interface {} []\n- .f: float64 42\n```\n\nIgnore values (type must still match):\n\n```diff\n$ jaydiff --report --show-types --ignore-excess --ignore-values old.json new.json\n\n- .c.b: float64 23\n+ .c.b: string 23\n- .e: []interface {} []\n- .f: float64 42\n```\n\nJSON streams:\n\n```diff\n$ jaydiff --stream --json old.json new.json\n\n [\n      {\"foo\":\"bar\"},\n     [\n         2,\n         3,\n         4,\n         {\n+            \"v\": \"some\"\n         }\n     ],\n+    {\"some\":\"thing\"}\n ]\n```\n\nValidating JSON stream types:\n\n```diff\n$ jaydiff --ignore-excess --ignore-values --stream-validate --report --show-types base.json stream.json\n\n- [1].bar: float64 4.2\n+ [1].bar: string !\n```\n\n## Ideas\n\n- JayPatch\n\nSponsored by [Datumprikker.nl](https://datumprikker.nl)\n","funding_links":[],"categories":["Software Packages","JSON","Go","Relational Databases","软件包","軟件包"],"sub_categories":["Other Software","Advanced Console UIs","检索及分析资料库","Search and Analytic Databases","SQL 查询语句构建库","其他软件","其他軟件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyazgazan%2Fjaydiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyazgazan%2Fjaydiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyazgazan%2Fjaydiff/lists"}