#json-diff #json #diff #cli #command-line #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 good support for array diffs.

7 unstable releases (3 breaking)

new 0.5.0 May 3, 2024
0.4.1 Mar 17, 2024
0.4.0 Feb 17, 2024
0.3.1 Nov 10, 2023
0.2.0 Oct 9, 2023

#1832 in Command line utilities

Download history 135/week @ 2024-01-16 167/week @ 2024-01-23 200/week @ 2024-01-30 127/week @ 2024-02-06 245/week @ 2024-02-13 78/week @ 2024-02-20 316/week @ 2024-02-27 53/week @ 2024-03-05 200/week @ 2024-03-12 105/week @ 2024-03-19 13/week @ 2024-03-26 45/week @ 2024-04-02 42/week @ 2024-04-09 51/week @ 2024-04-16 38/week @ 2024-04-23 201/week @ 2024-04-30

340 downloads per month
Used in havocompare

Unlicense

2.5MB
877 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