惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
D
Docker
J
Java Code Geeks
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
T
Tailwind CSS Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
腾讯CDC
罗磊的独立博客
U
Unit 42
爱范儿
爱范儿
Vercel News
Vercel News
MyScale Blog
MyScale Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Your package-lock.json diff is unreadable. That's a suppl...
benjamin · 2026-06-17 · via DEV Community
Cover image for Your package-lock.json diff is unreadable. That's a supply-chain problem.

benjamin

You open a pull request. It touches package-lock.json. GitHub shows you 4,000 lines of churned resolved URLs and integrity hashes. You scroll, your eyes glaze, you click Approve.

That habit is exactly how the bad stuff gets in. Nearly every npm supply-chain incident this year entered the same way: a new — often transitive — package landed in someone's lockfile, and nobody looked. Because the lockfile diff is unreadable by design.

Before merging, I want the answer to one question: what actually changed in my dependency tree? Not four thousand lines of hashes — just what's new, what's gone, what jumped a major version.

So I built locksift. Zero dependencies, no account, no network.

What it does

$ npx locksift package-lock.json --git

Added (2)  — new in tree, review these
  + ansi-styles@6.2.1
  + picocolors@1.0.1

Removed (1)
  - request@2.88.2

Changed (2)
  ↑ chalk  4.1.2 → 5.3.0 [major]
  ↓ semver  7.5.4 → 7.3.8 [downgrade]

+2  -1  ~2   (2 major, 1 downgrade)

--git diffs your working-tree lockfile against HEAD (or any ref you name) — the PR-review case. You can also just hand it two lockfiles.

The Added section is the one that matters for a supply-chain review: those are the packages that just entered your tree, including transitive ones you never explicitly asked for. Downgrades and major bumps get flagged too, since those are the changes most worth a second look.

Why not just git diff?

Because git diff works on text. A one-line npm install can rewrite thousands of lockfile lines — reordered entries, new hashes, changed resolved URLs — none of which tell you the thing you care about. locksift parses the lockfile structurally and diffs the actual dependency set. Signal, not churn.

And to be clear about what it is not: locksift is not a scanner. It won't tell you a package is malicious. It tells you a package is new — so you can decide whether to look. That's the step missing from most workflows today. Not more scanning; just making the diff reviewable enough that a human will actually read it.

Drop it into CI

# Fail the job if the lockfile changed at all
locksift package-lock.json --git --exit-code

# Or pipe just the newly added packages into your own tooling
locksift package-lock.json --git --added-only --json

Install

npx locksift ...        # Node build (npm)
pip install locksift    # Python build — same tool

There are two builds — Node and Python — that produce byte-for-byte identical output, so it slots into whatever toolchain your repo already speaks.

Supported lockfiles

package-lock.json (lockfileVersion 1, 2, and 3) and pipenv's Pipfile.lock. Both are plain JSON — which is exactly what lets locksift stay dependency-free.

Design notes, for the curious

  • Zero dependencies, both builds. Node uses only its stdlib; Python only its stdlib. A diff tool that dragged in 40 packages of its own would be a bad joke.
  • Pure core. All parsing/diffing is pure functions (text in, data out); file and git I/O live in the CLI. That keeps it trivially testable — and is how the two builds stay in lockstep.
  • A viewer by default. It exits 0 even when there are changes; add --exit-code to turn it into a gate. (The git diff --exit-code convention.)

Links


When was the last time you actually read a lockfile diff before approving a PR? What would make you trust a dependency change — and what do you use for this today? Curious whether anyone gates CI on lockfile changes already.