dep-impact-analyzer
v1.1.0
Published
Analyze code impact of dependency upgrades
Maintainers
Readme
dep-impact-analyzer
A CLI tool that helps you understand where your code will be affected before upgrading npm dependencies.
dep-impact-analyzer finds outdated dependencies and shows every file and line where each dependency is imported or required, so you can safely estimate upgrade impact.
✨ What This Tool Does
- 🔍 Detects outdated npm dependencies using
npm outdated - 🔢 Compares versions using semantic versioning
- 📄 Scans your source code for
importandrequireusage - 📍 Prints file paths and line numbers for each dependency
- ⚡ Works as a simple CLI (no config needed)
🚀 Quick Start (Recommended)
Run directly without installing:
npx dep-impact-analyzer
This runs the latest version and analyzes the current project.
📦 Install Globally (Optional)
If you use it often:
npm install -g dep-impact-analyzer
Then run:
dep-impact-analyzer
▶️ Usage
Run the command from the root of the project you want to analyze:
dep-impact-analyzer
The tool will:
Run npm outdated --json
Detect all outdated dependencies
Scan src/**/*.{js,ts,jsx,tsx} for each dependency
Print all matching file paths and line numbers
📄 Example Output
chalk 5.1.0 → 5.3.0
----------------------------------
src/report.ts:14
❌ Imported chalk
globby 11.1.0 → 16.0.0
----------------------------------
src/analyzeCode.ts:1
❌ Imported globby
🧠 How It Works
Outdated detection: npm outdated --json
Version comparison: semver
File scanning: globby
Code parsing: Babel parser + AST traversal
Import detection: import and require(...) statements
Reporting: CLI output with file paths and line numbers
🛠 Frameworks & stacks
- Frontend: Works with React, Angular, Vue, and other frameworks that use ES modules or CommonJS—because it scans imports/requires, not framework-specific APIs.
- Backend: Works with Node.js/Express, MongoDB drivers, and other server libraries; any `require`/`import` usage in `src/**/*.{js,ts,jsx,tsx}` is reported.
⚠️ Limitations
This tool shows where dependencies are used, not how to refactor them
Runtime or behavioral breaking changes are not detected
Only scans files under src/
False positives are possible for dynamic imports