CLI tool to compare JSON files. Useful for i18n files.
npm install json-key-compareA simple, fast, and lightweight CLI tool to recursively compare JSON files and identify missing keys. Built with Bun.
- š Recursive Comparison: deeply compares nested objects found in your JSON files.
- š Multi-file Support: Compare a base JSON file against multiple other files at once.
- ā” Fast: Built on the recursive logic using the fast Bun runtime.
- šÆ Precise Reporting: specific output pinpointing exactly which keys are missing (e.g., config.database.host).
- ⨠Zero Dependencies: Lightweight and efficient.
You can run this tool directly using bun.
Install globally with bun:
``bash`
bun add -g json-key-compare
Compare two files:
`bash`
json-key-compare base.json target.json
Compare a base file against multiple target files:
`bash`
json-key-compare en.json fr.json es.json
`text
š fr.json
ā 2 missing key(s):
⢠common.buttons.delete
⢠pages.settings.theme
š es.json
ā No missing keys
`
To install dependencies:
`bash`
bun install
To run tests:
`bash``
bun test
MIT