There's the jq tool you can use to print out a json with sorted keys jq -S . A.json. Then compare the results with any text-diffing tool you like. On my linux I'd maybe do
diff <(jq -S . A.json) <(jq -S . B.json)
If you are using Nodejs, apart from using `jq`, another approach is to use JSum node package
There's the
jq
tool you can use to print out a json with sorted keysjq -S . A.json
. Then compare the results with any text-diffing tool you like. On my linux I'd maybe doIf you are using Nodejs, apart from using `jq`, another approach is to use JSum node package
See this https://www.npmjs.com/package/jsum for more information
It is fast and does take care ordering Json object keys and checking checksum. This ensures that semantically same Jsons compare the right way