Prune-deps is a tool used for analyzing the usage of dependencies and pruning unused dependencies in package.json.
- Node >= 16
npm install -g prune-deps
Depcheck not only recognizes the dependencies in JavaScript files but also supports these syntaxes:
- JavaScript (ES5, ES6 and ES7)
- React JSX
- CoffeeScript
- TypeScript (with
typescript
dependency) - SASS and SCSS
- Vue.js (with
@vue/compiler-sfc
dependency)
To get the syntax support by external dependency, please install the corresponding package explicitly. For example, for TypeScript user, install depcheck with typescript
package:
npm install -g depcheck typescript
Prune-deps supports depcheck config (prune.json file should be provided in the directory where prune-deps is running).
To start using prune-deps, position inside a directory with package.json then run prune-deps
.
Select one of two options (View usage of dependencies or prune dependencies):
View usage of dependencies:
Pruning of dependencies: