This project is a JavaScript application designed to compare JSON files across multiple folders. It recursively scans directories, identifies JSON files with the same relative paths, and compares their content line by line. Differences between files are logged to the console.
- Recursive JSON File Search: Scans nested directories to locate JSON files.
- Line-by-Line Comparison: Compares JSON files line by line for differences.
- Cross-Folder Comparison: Compares JSON files with the same relative paths across multiple folders.
- Detailed Logging: Logs differences and file paths for easy debugging.
- Node.js (version 14 or higher)
- npm (Node Package Manager)
-
Clone the Repository:
git clone https://github.com/mohamedsaidibrahim/JSON-Comparison-Tool.git cd json-comparison-tool
-
Install Dependencies: No external dependencies are required.
-
Set Up Folders:
- Update the
ancestorFolders
array inindex.js
with the paths to your folders.
- Update the
-
Update the
ancestorFolders
array inindex.js
:const ancestorFolders = [ "C:\\path\\to\\folder1", "C:\\path\\to\\folder2", ];
-
Run the application:
npm start
- The tool will log the following:
- ❌ Differences found in:
[relative path]
(for files with differences). - ✅ Comparison completed (when the process finishes).
- ❌ Differences found in:
json-comparison-tool/
├── src/
│ ├── findJsonFiles.js # Recursively finds JSON files in a directory
│ ├── compareJsonFiles.js # Compares two JSON files line by line
│ └── compareAncestorFolders.js # Main script to compare JSON files across folders
├── index.js # Entry point for the application
├── package.json # Project dependencies and configuration
└── README.md # Project documentation
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.
For any questions or issues, please open an issue on the GitHub repository.
json-comparison-tool, json-file-comparison, javascript-application, nodejs-tool, file-comparison, json-processing, recursive-file-search, line-by-line-comparison, cross-folder-comparison, data-comparison, json-diff, file-diff, automation-tool, open-source-tool, javascript, nodejs, es6-modules, file-system-module, async-await, data-analysis, data-validation, developers, data-engineers, open-source-project