wtf-dependencies
v1.0.1
Published
**wtf-dependencies** is a CLI tool to trace where (and how deeply) a given dependency is nested in your Node.js project's dependency tree (from package-lock.json). Useful for understanding why a package is present in node_modules.
Readme
WTF-Dependencies 
wtf-dependencies is a CLI tool to trace where (and how deeply) a given dependency is nested in your Node.js project's dependency tree (from package-lock.json). Useful for understanding why a package is present in node_modules.
Install:
- From npm (recommended):
npm install wtf-dependencies- or globally:
npm install -g wtf-dependencies
- Or clone:
git clone <repo-url> && cd wtf-dependency && npm install - (Optional, for local dev):
npm link
Usage:
- After global install, run from any project root (where package-lock.json is):
wtf-dependencies <dependency-name>- Example:
wtf-dependencies lodash
Output Examples:
- Direct:
Dependencies path: lodash - Nested:
Dependencies path: foo → bar → lodash - Not found:
No dependencies found in package-lock.jsonorUsage: wtf-dependencies <dependency-name>
Error Handling:
- No package-lock.json found: Run from the correct directory.
- No dependencies found: Run
npm installto generate dependencies. - No dependency name: Add the name to the command.
Notes:
- Supports npm v7+ (package-lock v2/v3) and older lockfile formats.
- Run from your project root, not node_modules.
Contributing:
- Fork, branch, commit, and open a pull request.
- For bugs/features, open an issue.
License: ISC. See LICENSE.
Changelog:
- 1.0.0: Initial release (npm v7+ and legacy support)
