hugodep

hugodep is for analyzing the dependencies in a project to see: how each dependency is used, and which dependencies are useless. The same goals as depcheck, but this library works 100% guaranteed without false alarms, with a 2% of their lines of code.

Usage no npm install needed!

<script type="module">
  import hugodep from 'https://cdn.skypack.dev/hugodep';
</script>

README

hugodep

hugodep is for analyzing the dependencies in a project to see: how each dependency is used, and which dependencies are useless. The same goals as depcheck, but this library works 100% guaranteed without false alarms, with a 2% of their lines of code.

Any syntax, any language

Without need of plugins, this tool supports every language and every syntax you can define in the scripts section of the package.json file.

Usage

This tool requires node.js. If you want faster results use an SSD and deactivate any file monitor. Its preferred to be run overnight.

Set --use-yarn argument for utilizing the faster yarn. Omit that argument for utilizing npm.

Take into account what package.json scripts you pass to run, because if you forget to pass any critical script you are going to get inaccurate results.

This example analyzes the dependencies running only the script build and only the script test, with npx:

npx hugodep --run build --run test

Package.json scripts

The package.json scripts should have a finish, i.e., scripts should not be on watch mode. For example, with create-react-app modify the test script as:

"scripts": {
    "test": "react-scripts test --watchAll=false",
    ...
}