DevTools Logo

Lockfile Diff Analyzer

Lockfile Diff Analyzer

Compare two lockfiles and review version changes, downgrades and surprising jumps.

Runs in your browser
Try an example

Before

After

Version changes

No diff yet

Paste a before and after lockfile, or load the npm example.

Examples

Major bump

Input
react 18.2.0 → 19.0.0
Output
changed (major), flagged review

A major bump may contain breaking changes and deserves a changelog check.

Patch bump

Input
lodash 4.17.20 → 4.17.21
Output
changed (patch), no flag

Patch releases are the routine case.

Version rollback

Input
foo 2.0.0 → 1.0.0
Output
changed (downgrade), flagged review

Downgrades often indicate an accidental revert or a forced resolution.

About this tool

Lockfile Diff Analyzer answers a narrow but frequent review question: what exactly changed between these two dependency lockfiles? Paste a before and after snapshot to get a sorted table of added, removed and version-changed packages, with semantic-version change classes attached to each row.

The parser recognises package-lock.json (both the modern packages map and legacy dependencies), Yarn v1 lock headers with nested version fields, pnpm-lock.yaml package keys and a plain name@version list. Format detection is automatic, and parser notes explain entries it could not read instead of hiding them.

Version changes are classified as major, minor, patch, prerelease or downgrade using a small semver comparison. Major bumps, downgrades, unparseable ranges and 'latest' targets are marked for review, because these are the changes most likely to need a migration check or a closer look at the changelog. Packages that did not change are omitted.

Use the filter chips to focus on additions, removals, changed versions or review flags, then copy the diff as Markdown for a pull request or download it as CSV. The comparison is entirely client-side — lockfiles often reveal internal registry URLs and package names, so they are never uploaded.

What this tool does not do

  • Only npm, Yarn v1, pnpm-style and simple name@version snapshots are parsed; other formats need conversion.
  • Transitive dependencies are identified by package name only; nested copies with different versions are not fully distinguished.
  • Version classification uses numeric semver; non-semver ranges such as git SHAs are marked unknown.
  • No registry lookups, advisory checks or changelog retrieval are performed.
  • Lockfile contents are kept in memory for the session and are not saved between reloads.

How to use this tool

  1. Paste two snapshots

    Put the old lockfile in Before and the new one in After. Example chips load an npm major-bump pair, a Yarn pair and an invalid JSON case.

  2. Check detected formats

    Each input panel shows the detected format and package count. Parser notes appear above the results when entries were skipped.

  3. Review the diff

    Rows are sorted by package name. Version changes carry a bump class; risky ones carry a 'review' badge.

  4. Filter the noise

    Use All, Added, Removed, Changed or Review to focus the table on the changes that matter to your review.

  5. Export the result

    Copy the Markdown diff into a PR description or download the CSV for a spreadsheet or audit record.

Use cases

Dependency upgrade PRs

Summarise what a renovate/dependabot PR actually changed before approving it.

Release audits

Attach a readable dependency diff to a release note or internal changelog.

Debugging installs

Spot a surprising downgrade or a 'latest' target that makes installs irreproducible.

Cross-tool migrations

Compare a Yarn lock before migration with the npm lockfile generated afterwards.

Recognised lockfile shapes

FormatExample
npm (modern)"node_modules/react": { "version": "18.2.0" }
npm (legacy)"dependencies": { "react": { "version": "18.2.0" } }
Yarn v1"foo@^1.0.0":\n version "1.2.3"
pnpm /foo/1.2.3:
Genericfoo@1.2.3 per line

npm filenames are auto-detected by JSON structure; you can still paste any supported shape into either panel.

Common mistakes

Mistake:Expecting a security advisory scan.

Fix:This tool compares versions only; it does not query vulnerability databases or semver dist-tags.

Mistake:Assuming 'latest' is a normal version.

Fix:It is flagged for review because it makes installs non-reproducible.

Mistake:Treating added/removed packages as review flags.

Fix:Only version changes are classified; additions and removals are listed without a risk badge.

Mistake:Comparing a manifest to a lockfile.

Fix:Paste two lockfiles. A package.json contains ranges rather than resolved versions.

Mistake:Expecting merged duplicates.

Fix:If the same package name appears twice with different versions, the first version is kept and a parser note is shown.

Frequently asked questions

Which lockfile formats are supported?

package-lock.json (modern packages map and legacy dependencies), Yarn v1 yarn.lock, pnpm-lock.yaml package keys, and a plain list of name@version lines. Format detection is automatic based on JSON structure and characteristic line patterns.

What does the review badge mean?

It marks a version change that deserves a second look: a major bump, a downgrade, an unparseable version or a target such as 'latest'. Added and removed packages are listed but are not automatically flagged as risky.

How are bump classes determined?

Versions are parsed as numeric semver (an optional leading v is accepted). Changes in the major, minor or patch component are labelled accordingly; a component that stays the same but gains or changes a prerelease suffix is labelled prerelease; a lower version tuple is a downgrade.

Does this check for vulnerable packages?

No. The analyzer is offline and never contacts a registry or advisory database. It compares resolved versions between two snapshots; use a dedicated vulnerability scanner for security checks.

Why do some packages appear only on one side?

Those are additions (only in After) or removals (only in Before). Packages whose version is identical in both snapshots are omitted so the table stays focused on real changes.

Are my lockfiles uploaded anywhere?

No. Both snapshots are parsed in your browser tab, and neither the contents nor the diff leave the page. Nothing is persisted; reloading starts with empty inputs.

References & standards