Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deps

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deps

Node dependency usage checker using V8 Coverage

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7K
increased by51.8%
Maintainers
1
Weekly downloads
 
Created
Source

📦 deps


Accurately detect which Node dependencies are in-use with V8 Coverage 🔥

Try it out!
$ npx deps [...command]

eg. npx deps npm run build

:rocket: Install

Install globally if you don't want to use it via npx.

npm i -g deps

Usage

🔬 Quick analysis

Prefix your Node command with deps and it will analyze and output the dependencies it used

$ deps ...

eg. deps npm run build

👩‍🔬 Analyzing dependency usage across commands

Prerequisite: install deps globally

  1. Start recording dependecy usage (note the dot-space at the beginning)
$ . deps-start
  1. Run a series of Node scripts eg.
  • npm run dev
  • npm run build
  • npm run lint
  • etc.
  1. Analyze used dependencies
$ deps analyze
  • Save data to file:
    deps analyze -o output.json
    
  • Read later with:
    deps -f output.json
    
  1. When you're done, stop recording
$ . 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.

💼 License

MIT

Keywords

FAQs

Package last updated on 20 Jun 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc