Dependency Diff Checker
Paste two versions of your dependency file (e.g., `package.json`) to see a clear summary of what’s changed.
How to Use
Paste 'Before' File: Paste the original version of your dependency file on the left.
Paste 'After' File: Paste the new or updated version of your dependency file on the right.
Review the Diff: The tool will instantly show you which packages were added, removed, or updated below.
Before
After
Dependency Changes
Provide two valid dependency files to see the diff...
Understanding Your Dependency Changes
When you update a branch or review a pull request, the list of project dependencies in files like `package.json` can change. A dependency diff tool is essential for clearly visualizing these changes. It helps you quickly identify which packages were added, which were removed, and—most importantly—which were updated. Understanding the semantic versioning (SemVer) impact of these updates is key to preventing breaking changes and maintaining a healthy codebase.
Frequently Asked Questions
What file formats does this tool support?
This tool is designed to work with `package.json` (npm), but the core logic can be adapted for other dependency manifest files like `composer.json` (PHP) or `requirements.txt` (Python). The current demonstration focuses on the JSON structure of `package.json`.
How does it determine the SemVer impact?
A full implementation would use a Semantic Versioning (SemVer) library to parse the version numbers (e.g., `1.2.3` to `2.0.0`). It would then compare the major, minor, and patch components to classify the change. For example, a change in the first number (major) is a breaking change, the second (minor) is a new feature, and the third (patch) is a bug fix.
Can I use this for lockfiles like `package-lock.json`?
Yes, comparing lockfiles is a great use case! The principle is the same: parse the 'before' and 'after' versions and compare the dependency trees. This tool's UI can be used for that, but the parsing logic would need to be more sophisticated to handle the detailed structure of lockfiles.
Is my data secure?
Absolutely. All the comparison logic runs directly in your browser. The contents of your `package.json` or other files are never sent to any server, ensuring your project's information remains private.
Why is diffing dependencies important?
It's crucial for understanding the impact of an update. A small patch update is usually safe, but a major version bump could introduce breaking changes that require you to update your own code. This tool helps you see exactly what's changing in a pull request or before you merge a feature branch.