#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 good support for array diffs.

6 releases

0.4.1 Mar 17, 2024
0.4.0 Feb 17, 2024
0.3.1 Nov 10, 2023
0.3.0 Oct 28, 2023
0.2.0 Oct 9, 2023

#1852 in Command line utilities

Download history 100/week @ 2023-12-30 146/week @ 2024-01-06 160/week @ 2024-01-13 159/week @ 2024-01-20 194/week @ 2024-01-27 147/week @ 2024-02-03 62/week @ 2024-02-10 252/week @ 2024-02-17 314/week @ 2024-02-24 53/week @ 2024-03-02 67/week @ 2024-03-09 234/week @ 2024-03-16 31/week @ 2024-03-23 36/week @ 2024-03-30 41/week @ 2024-04-06 59/week @ 2024-04-13

179 downloads per month
Used in havocompare

Unlicense

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