#diff #json-diff #json #cli #jsons

bin+lib json_diff

A small diff tool utility for comparing jsons

3 releases

0.1.2 Sep 22, 2020
0.1.1 Nov 24, 2019
0.1.0 Nov 24, 2019

#6 in #json-diff

Download history 87/week @ 2024-12-19 31/week @ 2024-12-26 140/week @ 2025-01-02 259/week @ 2025-01-09 363/week @ 2025-01-16 442/week @ 2025-01-23 297/week @ 2025-01-30 153/week @ 2025-02-06 192/week @ 2025-02-13 216/week @ 2025-02-20 237/week @ 2025-02-27 198/week @ 2025-03-06 186/week @ 2025-03-13 146/week @ 2025-03-20 122/week @ 2025-03-27 244/week @ 2025-04-03

730 downloads per month

Unlicense

2.5MB
483 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.

Screenshot of diff results

A screenshot of a sample diff with json_diff

Usage Example:

$ json_diff f source1.json source2.json
$ json_diff d '{...}' '{...}'

Option:

f : read input from json files
d : 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–11MB
~121K SLoC