package.json知道有没有没有用到的依赖
package.json know if there are any dependencies that are not used
我有一个依赖项目,我想知道这些依赖中有哪些从未被使用过。
示例我有以下依赖项:
"dependencies": {
"axios": "^0.19.2",
"d3": "^5.16.0",
"d3-scale": "^3.2.2",
...
}
假设在我的项目中我从未使用过我安装的依赖项d3
,我希望它向我报告。
如何获取所有已安装但未使用的依赖项的列表?
有一个package。
npm install -g depcheck
运行在你的项目目录
depcheck
查看结果
Unused dependencies
* chalk
* express
Unused devDependencies
* nodemon
我有一个依赖项目,我想知道这些依赖中有哪些从未被使用过。
示例我有以下依赖项:
"dependencies": {
"axios": "^0.19.2",
"d3": "^5.16.0",
"d3-scale": "^3.2.2",
...
}
假设在我的项目中我从未使用过我安装的依赖项d3
,我希望它向我报告。
如何获取所有已安装但未使用的依赖项的列表?
有一个package。
npm install -g depcheck
运行在你的项目目录
depcheck
查看结果
Unused dependencies
* chalk
* express
Unused devDependencies
* nodemon