#json-diff #json #diff #cli #command-line #object #json-object

bin+lib json_diff_ng

A small diff tool utility for comparing jsons. Forked from ksceriath and improved for usage as a library and with proper support for array diffs.

8 releases (4 breaking)

new 0.6.0-RC1 May 22, 2024
0.5.0 May 3, 2024
0.4.1 Mar 17, 2024
0.4.0 Feb 17, 2024
0.2.0 Oct 9, 2023

#1746 in Command line utilities

Download history 143/week @ 2024-02-02 84/week @ 2024-02-09 252/week @ 2024-02-16 281/week @ 2024-02-23 93/week @ 2024-03-01 58/week @ 2024-03-08 238/week @ 2024-03-15 42/week @ 2024-03-22 32/week @ 2024-03-29 41/week @ 2024-04-05 49/week @ 2024-04-12 35/week @ 2024-04-19 53/week @ 2024-04-26 231/week @ 2024-05-03 92/week @ 2024-05-10 164/week @ 2024-05-17

548 downloads per month
Used in havocompare

Unlicense

2.5MB
873 lines

json-diff

json-diff is a command line utility to compare two jsons.

Input can be fed as inline strings or through files.
For readability, output is neatly differentiated into three categories: keys with different values, and keys not present in either of the objects.
Only missing or unequal keys are printed in output to reduce the verbosity.

Usage Example:

$ json_diff file source1.json source2.json
$ json_diff direct '{...}' '{...}'

Option:

file : read input from json files
direct : read input from command line

Installation

Currently, json-diff is available through crates.io (apart from building this repo directly). For crate installation,

  • Install cargo, through rustup
    $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Install json-diff
    $ cargo install json_diff

Dependencies

~4.5–6.5MB
~118K SLoC