All Projects → yudai → Gojsondiff

yudai / Gojsondiff

Licence: other
Go JSON Diff

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Gojsondiff

Diffson
A scala diff/patch library for Json
Stars: ✭ 258 (-30.46%)
Mutual labels:  json, patch, diff
Jsondiffpatch
Diff & patch JavaScript objects
Stars: ✭ 3,951 (+964.96%)
Mutual labels:  json, patch, diff
diffy
Tools for finding and manipulating differences between files
Stars: ✭ 47 (-87.33%)
Mutual labels:  diff, patch
intellij-diff-plugin
Syntax highlighting for .diff files and .patch files in IntelliJ IDEs
Stars: ✭ 17 (-95.42%)
Mutual labels:  diff, patch
deltaq
Fast and portable delta encoding for .NET in 100% safe, managed code.
Stars: ✭ 26 (-92.99%)
Mutual labels:  diff, patch
Json Git
A pure JS local Git to versionize any JSON
Stars: ✭ 109 (-70.62%)
Mutual labels:  json, diff
Cfgdiff
diff(1) all your configs
Stars: ✭ 138 (-62.8%)
Mutual labels:  json, diff
duff
Pure OCaml implementation of libXdiff (Rabin's fingerprint)
Stars: ✭ 20 (-94.61%)
Mutual labels:  diff, patch
Ex audit
Ecto auditing library that transparently tracks changes and can revert them.
Stars: ✭ 214 (-42.32%)
Mutual labels:  patch, diff
tmux-eaw-fix
tmux 2.6 以降において East Asian Ambiguous Character を全角文字の幅で表示する
Stars: ✭ 16 (-95.69%)
Mutual labels:  diff, patch
Jaydiff
A JSON diff utility
Stars: ✭ 84 (-77.36%)
Mutual labels:  json, diff
Dyff
/ˈdʏf/ - diff tool for YAML files, and sometimes JSON
Stars: ✭ 277 (-25.34%)
Mutual labels:  json, diff
Sirix
SirixDB is a temporal, evolutionary database system, which uses an accumulate only approach. It keeps the full history of each resource. Every commit stores a space-efficient snapshot through structural sharing. It is log-structured and never overwrites data. SirixDB uses a novel page-level versioning approach called sliding snapshot.
Stars: ✭ 638 (+71.97%)
Mutual labels:  json, diff
Api Diff
A command line tool for diffing json rest APIs
Stars: ✭ 164 (-55.8%)
Mutual labels:  json, diff
Jsondiff
Diff JSON and JSON-like structures in Python
Stars: ✭ 404 (+8.89%)
Mutual labels:  json, diff
dipa
dipa makes it easy to efficiently delta encode large Rust data structures.
Stars: ✭ 243 (-34.5%)
Mutual labels:  diff, patch
Python Patch
Library to parse and apply unified diffs
Stars: ✭ 65 (-82.48%)
Mutual labels:  patch, diff
Apkdiffpatch
a C++ library and command-line tools for Zip(Jar,Apk) file Diff & Patch; create minimal delta/differential; support Jar sign(apk v1 sign) & apk v2,v3 sign .
Stars: ✭ 121 (-67.39%)
Mutual labels:  patch, diff
go-gitdiff
Go library for parsing and applying patches created by Git
Stars: ✭ 41 (-88.95%)
Mutual labels:  diff, patch
Editscript
A library designed to diff and patch Clojure data structures
Stars: ✭ 281 (-24.26%)
Mutual labels:  patch, diff

Go JSON Diff (and Patch)

Wercker GoDoc MIT License

How to use

Installation

go get github.com/yudai/gojsondiff

Comparing two JSON strings

See jd/main.go for how to use this library.

CLI tool

This repository contains a package that you can use as a CLI tool.

Installation

go get github.com/yudai/gojsondiff/jd

Usage

Diff

Just give two json files to the jd command:

jd one.json another.json

Outputs would be something like:

 {
   "arr": [
     0: "arr0",
     1: 21,
     2: {
       "num": 1,
-      "str": "pek3f"
+      "str": "changed"
     },
     3: [
       0: 0,
-      1: "1"
+      1: "changed"
     ]
   ],
   "bool": true,
   "num_float": 39.39,
   "num_int": 13,
   "obj": {
     "arr": [
       0: 17,
       1: "str",
       2: {
-        "str": "eafeb"
+        "str": "changed"
       }
     ],
+    "new": "added",
-    "num": 19,
     "obj": {
-      "num": 14,
+      "num": 9999
-      "str": "efj3"
+      "str": "changed"
     },
     "str": "bcded"
   },
   "str": "abcde"
 }

When you prefer the delta format of jsondiffpatch, add the -f delta option.

jd -f delta one.json another.json

This command shows:

{
  "arr": {
    "2": {
      "str": [
        "pek3f",
        "changed"
      ]
    },
    "3": {
      "1": [
        "1",
        "changed"
      ],
      "_t": "a"
    },
    "_t": "a"
  },
  "obj": {
    "arr": {
      "2": {
        "str": [
          "eafeb",
          "changed"
        ]
      },
      "_t": "a"
    },
    "new": [
      "added"
    ],
    "num": [
      19,
      0,
      0
    ],
    "obj": {
      "num": [
        14,
        9999
      ],
      "str": [
        "efj3",
        "changed"
      ]
    }
  }
}

Patch

Give a diff file in the delta format and the JSON file to the jp command.

jp diff.delta one.json

License

MIT License (see LICENSE for detail)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].