
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
json-diff-cli
Advanced tools
json-diff-cli allows you to diff the JSON of two urls and see what the differences are. This tool can be used for testing purposes or to simply check that things are working.
Commands:
help [command...] Provides help for a given command.
exit Exits application.
diff [options] <leftURL> <rightURL> diffs the json response of two URLs.
csv [options] <path> diffs all urls in a csv file
jsondiff diff <leftURL> <rightURL> [options]
leftURL: The base URL you would like to compare to.
rightURL: The new/updated URL. The JSON from rightURL will be compared with the leftURL and changes will be printed out to the console.
Usage: diff [options] <leftURL> <rightURL>
diffs the json response of two URLs.
Options:
--help output usage information
-o, --output <file> print the output to a CSV file
-x, --diffheaders diff the headers as well as the body
-H, --headers <string> attach a header to the request. You may string multipe headers together by passing along more -H or --header options
-i, --ignore <key> ignore the provided key. You may string multipe ignore keys together by passing along more -i or --ignore options
-m, --method <method> request method (GET, POST, or DELETE)
-b, --body <body> Request body (only for POST)
-k, --sortkey <key> Sort any array of json objects by the specified key
-t, --timeout <milliseconds> timeout for requests. defaults to 5 seconds
{
"foo": {
"bar": {
"a": true,
"b": "now u see me"
}
}
}
{
"foo": {
"bar": {
"a": false,
"c": "now you dont"
}
}
}
key left right diff
--------- ------------ ------------ -------
foo.bar.c undefined now you dont added
foo.bar.b now u see me undefined deleted
foo.bar.a true false updated
jsondiff csv <input> [options]
input: Path to the input file (CSV format).
Usage: csv [options] <path>
diffs all urls in a csv file
Options:
--help output usage information
-o, --output <file> print the output to a CSV file
-s, --sleep <milliseconds> sleep before every request (in milliseconds)
-x, --diffheaders diff the headers as well as the body
-t, --timeout <milliseconds> timeout for requests. defaults to 5 seconds
The first line in the CSV file must have the following headers. You may chose to omit any of them except for ur1, and url2
url1, url2, method, headers, body, sortKey, ignore
ur1: Left URL
ur2: Right URL
method: Request method, defaults to GET [optional]
headers: Headers included in the request, pipe delimited. (|)
body: POST body, JSON
sortKeys: key to sort any arrays by.
ignore: keys to ignore. Pipe delimted. (|)
expectedStatusCode: Expected status code (defaults to 200)
url1,url2
https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json
https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json
https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json
id,left url,left response time,right url,right response time,key,left value,right value,difference,status
0,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,1197,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json,675,foo.bar.c,undefined,now you dont,added,fail
0,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,1197,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json,675,foo.bar.b,now u see me,undefined,deleted,fail
0,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,1197,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json,675,foo.bar.a,true,none,updated,fail
1,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,481,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json,533,foo.bar.c,undefined,now you dont,added,fail
1,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,481,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json,533,foo.bar.b,now u see me,undefined,deleted,fail
1,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,481,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json,533,foo.bar.a,true,none,updated,fail
2,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,396,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json,386,foo.bar.c,undefined,now you dont,added,fail
2,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,396,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json,386,foo.bar.b,now u see me,undefined,deleted,fail
2,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json,396,https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json,386,foo.bar.a,true,none,updated,fail
https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json vs https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json
key left right diff
--------- ------------ ------------ -------
foo.bar.c undefined now you dont added
foo.bar.b now u see me undefined deleted
foo.bar.a true false updated
https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json vs https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json
key left right diff
--------- ------------ ------------ -------
foo.bar.c undefined now you dont added
foo.bar.b now u see me undefined deleted
foo.bar.a true false updated
https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/a.json vs https://gist.githubusercontent.com/nahtnam/920171eeef10e911a6ee7698d9c226ae/raw/bdd86427b8c807e149251d4737d2886620f7fcdc/b.json
key left right diff
--------- ------------ ------------ -------
foo.bar.c undefined now you dont added
foo.bar.b now u see me undefined deleted
foo.bar.a true false updated
FAQs
json-diff-cli
The npm package json-diff-cli receives a total of 52 weekly downloads. As such, json-diff-cli popularity was classified as not popular.
We found that json-diff-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.