json-key-compare
v0.0.2
Published
CLI tool to compare JSON files. Useful for i18n files.
Downloads
11
Maintainers
Readme
JSON key compare CLI
A simple, fast, and lightweight CLI tool to recursively compare JSON files and identify missing keys. Built with Bun.
Features
- 🔍 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.
Usage
You can run this tool directly using bun.
Installation
Install globally with bun:
bun add -g json-key-compareBasic Usage
Compare two files:
json-key-compare base.json target.jsonMultiple Files
Compare a base file against multiple target files:
json-key-compare en.json fr.json es.jsonExample Output
📄 fr.json
✗ 2 missing key(s):
• common.buttons.delete
• pages.settings.theme
📄 es.json
✓ No missing keysDevelopment
To install dependencies:
bun installTo run tests:
bun testLicense
MIT
