
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
lockfile-guardian
Advanced tools
Never forget to install dependencies again! Automatically detect when your lock files change after git operations and warn you (or auto-install) when your dependencies are out of sync.
Never forget to install dependencies again! Automatically detect when your lock files change after git operations and warn you (or auto-install) when your dependencies are out of sync.
You know this scenario:
git pull or switch branchesnpm installLockfile Guardian installs git hooks that automatically detect when your lock files have changed and either warn you or auto-install dependencies.
npx lockfile-guardian install and you're done.git/ directory, not your working tree# Install and setup git hooks (one time only)
npx lockfile-guardian install
# That's it! Now every git operation checks your dependencies
.git/lockfile-guardianLockfile Guardian is fully compatible with Husky and works seamlessly alongside other tools:
.husky/ directory.git/hooks/ when Husky isn't detected# Your existing .husky/pre-commit
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged
# After installing lockfile-guardian, your .husky/post-checkout becomes:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Your existing hooks run first...
# Lockfile Guardian
npx lockfile-guardian check --hook
If you're already using Husky, just install normally:
npx lockfile-guardian install
Lockfile Guardian will:
.husky/ directory{
"scripts": {
"prepare": "husky"
},
"lint-staged": {
"*.{js,ts,tsx}": ["prettier --write", "eslint --fix"],
"*.{json,md}": ["prettier --write"]
},
"lockfileGuardian": {
"autoInstall": true,
"silent": false
}
}
Add optional configuration to your package.json:
{
"lockfileGuardian": {
"autoInstall": true, // Automatically run install commands
"silent": false, // Suppress non-warning output
"checkNodeModules": true // Warn if node_modules isn't gitignored (default: true)
}
}
# Setup git hooks (one-time setup)
npx lockfile-guardian install
# Remove all hooks and cleanup
npx lockfile-guardian uninstall
# Manually check for lock file changes
npx lockfile-guardian check
# Show help and current configuration
npx lockfile-guardian
Automatically detects and supports:
pnpm-lock.yaml → pnpm installyarn.lock → yarn installpackage-lock.json → npm installDetection priority: pnpm → yarn → npm (first lock file found wins)
$ git checkout feature/new-deps
=====================================
⚠️ DEPENDENCIES OUT OF DATE ⚠️
=====================================
Lock file pnpm-lock.yaml has changed!
Run this command to update:
pnpm install
=====================================
$ git pull origin main
🔒 Lock file yarn.lock has changed!
🔒 Auto-installing dependencies with yarn...
yarn install v1.22.19
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
✨ Done in 2.34s.
🔒 Dependencies updated successfully!
Git hooks:
.git/hooks/post-checkout - Runs after branch switching.git/hooks/post-merge - Runs after git pull/git merge.git/hooks/post-rewrite - Runs after git rebaseMetadata:
.git/lockfile-guardian - Stores hash of current lock fileNothing in your working directory! All tool data stays in .git/ where it belongs.
node_modules isn't properly ignoredFor individuals:
For teams:
| Tool | Setup | Auto-install | Zero deps | Git integrated | Husky compatible |
|---|---|---|---|---|---|
| Lockfile Guardian | ✅ One command | ✅ Optional | ✅ Yes | ✅ Native hooks | ✅ Yes |
@antfu/ni | ❌ Manual usage | ❌ Manual | ❌ No | ❌ No | ❌ No |
| Manual git hooks | ❌ Complex setup | ❌ Script required | ✅ Yes | ✅ Yes | ⚠️ Manual |
| IDE extensions | ❌ Per-editor setup | ❌ Usually not | ❌ No | ❌ No | ❌ No |
This tool is designed to be simple and focused. If you have ideas for improvements, please open an issue to discuss before implementing major changes.
MIT
This tool was mostly written by Cursor and Claude 4 Sonnet.
FAQs
Never forget to install dependencies again! Automatically detect when your lock files change after git operations and warn you (or auto-install) when your dependencies are out of sync.
We found that lockfile-guardian demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.