dependency-cli
v1.0.1
Published
Here’s an improved and professional version of your `README.md` — it’s clearer, better formatted, and easier to scan:
Readme
Here’s an improved and professional version of your README.md — it’s clearer, better formatted, and easier to scan:
🧩 Dependency Checker
A powerful CLI tool to analyze and optimize your Node.js dependencies. Easily detect unused, missing, outdated, and duplicate dependencies, scan for security vulnerabilities, and apply automated fixes to keep your project healthy and efficient.
✨ Features
- 🔍 Unused Dependencies – Identify packages in
package.jsonthat are not used in your codebase. - ❓ Missing Dependencies – Detect imports or requires that aren’t listed in
package.json. - ⬆️ Outdated Dependencies – Find packages that can be updated to newer versions.
- 🔐 Security Vulnerabilities – Scan for known issues using
npm audit. - 🧬 Duplicate Packages – Highlight multiple versions of the same dependency.
- 📊 Health Score – Calculate an overall dependency health score (0–100).
- 🛠️ Automated Fixes – Apply safe fixes: remove unused, update outdated, deduplicate, and patch vulnerabilities.
📦 Installation
Global (recommended)
npm install -g dependency-cliLocal (dev dependency)
npm install --save-dev dependency-cli🚀 Usage
Run commands from the root of your project (where package.json exists).
🔍 Summary
dependency-cli summaryOutput in JSON format:
dependency-cli summary --json🛠 Fix Issues
dependency-cli fix --outdated --yesAvailable fix options:
--unused– Remove unused packages--outdated– Update outdated packages--vulnerabilities– Fix known vulnerabilities--duplicates– Deduplicate packages--all– Apply all fixes--force– Force removal of protected packages-y, --yes– Skip confirmation prompts
📦 Unused Dependencies
dependency-cli unused⬆️ Outdated Packages
dependency-cli outdated📈 Health Score
dependency-cli score🧪 Example Workflow
Step 1 – Check your project
dependency-cli summaryExample Output:
📊 Comprehensive Dependency Analysis
🚀 Project: my-project v1.0.1
Dependencies: 4 prod / 2 dev
Scripts: 3 npm scripts
Node engines: ⚪ Not specified
🔍 Unused Dependencies: ✅ All good
🔗 Missing Dependencies: ✅ All installed
📦 Outdated: ❌ chalk: 4.1.2 → 5.4.1
🔒 Vulnerabilities: ✅ None
🔁 Duplicates: ✅ None
💡 Suggestions:
• Run "dependency-cli fix --outdated" to update
• Run "dependency-cli fix --all" to fix everythingStep 2 – Apply fixes
dependency-cli fix --outdated --yesStep 3 – Re-check
dependency-cli summary📌 Notes
- Chalk Version – Uses
[email protected]for CommonJS compatibility.[email protected]is ES Module-only and not currently supported. - Protected Packages – Critical packages (e.g.,
react,eslint,typescript) are protected from removal unless--forceis used. - Requirements – Node.js v14 or higher. Must be run in a directory with a valid
package.json.
🤝 Contributing
Contributions are welcome! Feel free to open an issue or submit a PR on the GitHub repository.
📄 License
Licensed under the [MIT License]
Would you like me to generate a Markdown file version or auto-push it to GitHub if your repo is linked?
