Node dependency usage checker using V8 Coverage
npm install deps

Accurately detect which Node dependencies are in-use with V8 Coverage 🔥
#### Try it out!
``sh`
$ npx deps [...command]npx deps npm run build
_eg. _
sh
npm i -g deps
`Usage
$3
Prefix your Node command with deps and it will analyze and output the dependencies it used
`sh
$ deps ...
`
eg. deps npm run build$3
_Prerequisite: install deps globally_
1. Start recording dependecy usage (note the dot-space at the beginning)
`sh
$ . deps-start
`2. Run a series of Node scripts eg.
-
npm run dev
- npm run build
- npm run lint
- etc.3. Analyze used dependencies
`sh
$ deps analyze
`
- Save data to file:
`sh
deps analyze -o output.json
`
- Read later with:
`sh
deps -f output.json
`4. When you're done, stop recording
`sh
$ . deps-stop
`💁♂️ FAQ
#### How does it work?
deps detects which modules are loaded by using V8's code coverage feature, so it's very accurate. However, it doesn't detect file-system reads, as they are simply read as text rather than actually being parsed and executed. That means it can't detect what files are statically analyzed by bundlers (eg. Webpack, Rollup, etc.). I am considering supporting FS reads in the future.#### How does it compare to
depcheck?
depcheck statically analyzes your project to see which dependencies are imported, avoiding the need to execute code. In contrast, deps executes code to analyze which dependencies were loaded during run-time. They work in completely different ways, but a major drawback for me is that depcheck` requires a "special" for supporting whether a module was loaded via dev-tools.