Crates.io | jsondiff |
lib.rs | jsondiff |
version | 0.1.0 |
source | src |
created_at | 2021-09-12 18:09:13.431004 |
updated_at | 2021-09-12 18:09:13.431004 |
description | A tool for outputs semantic difference of json |
homepage | |
repository | https://github.com/mpppk/jsondiff |
max_upload_size | |
id | 450157 |
size | 23,609 |
A tool for outputs semantic difference of json.
"semantic" means:
$ cargo install jsondiff
test1.json
{
"b": "bv",
"arr": [1,2,3],
"arr2": [
{"a": "av", "obj": {"arr": [1,2,3], "z": "zv"}},
{"b": "bv", "obj": {"arr": [2,3,1], "z": "zv"}},
{"c": "cv", "obj": {"arr": [3,2,1], "z": "zv"}}
]
}
test2.json
{
"b": "bv",
"arr": [1,3,2],
"arr2": [
{"c": "cv", "obj": {"arr": [2,3,1], "z": "zv"}},
{"b": "bv", "obj": {"arr": [1,2,3], "z": "zv"}},
{"a": "av", "obj": {"arr": [3,2,1], "z": "zv"}}
]
}
test3.json
{
"b": "bv",
"arr": [3,2,1],
"arr2": [
{"c": "cv", "obj": {"arr": [1,2,3], "z": "zv"}},
{"b": "bv", "obj": {"arr": [2,3,1], "z": "zv"}},
{"a": "av", "obj": {"arr": [3,2,1,4], "z": "zv"}}
]
}
$ jsondiff test1.json test2.json
// => no output (no difference)
$ jsondiff test1.json test3.json
10: "arr": [
11: 1,
12: 2,
13: - 3
13: + 3,
13: + 4
14: ],
15: "z": "zv"
16: }
----
$ jsondiff --help
jsondiff 0.1.0
A tool for outputs semantic difference of json
USAGE:
jsondiff [FLAGS] [OPTIONS] <file-path1> <file-path2>
FLAGS:
-h, --help Prints help information
-n, --output-normalized-json Outputs normalized json as "normalized1.json" and "normalized2.json"
-V, --version Prints version information
OPTIONS:
-U <unified> Generate diffs with <n> lines of context [default: 3]
ARGS:
<file-path1>
<file-path2>