1- # @codegenius/clear -plugin
1+ # @codegenius/quantity -plugin
22
3- 运行 ` rimraf ` 删除不再需要的文件或文件夹, 支持命令模式, 询问模式和 ** API** 模式;
4-
5- 使用场景: 用于删除可以通过项目运行自动生成的文件, 如: ` dist ` 目录, 还有顽固的 ` node_modules ` .
3+ 运行 ` cloc ` 分析并统计代码量
64
75## 安装
86
97``` bash
10- npm i @codegenius/clear -plugin -D
8+ npm i @codegenius/quantity -plugin -D
119```
1210
1311``` javascript
1412import { defineConfig } from " code-genius" ;
15- import { clearInstaller } from " @codegenius/clear -plugin" ;
13+ import { quantityInstaller } from " @codegenius/quantity -plugin" ;
1614
1715export default defineConfig ({
18- plugins: [
19- clearInstaller ({
20- files: [" ./dist" , " ./node_modules" ],
21- }),
22- ],
16+ plugins: [quantityInstaller ()],
2317});
2418```
2519
@@ -28,36 +22,20 @@ export default defineConfig({
2822### 命令模式
2923
3024``` bash
31- # 删除 dist 文件夹
32- codeg clear -p ./dist
33-
34- # 删除 dist 和 node_modules 两个文件夹
35- codeg clear -p ./dist -p ./node_modules
36- ```
37-
38- | 选项 | 描述 |
39- | ------------------------- | ------------ |
40- | -p, --pattern \< pattern\> | 设置匹配规则 |
41- | -a, --ask | 启用询问模式 |
42-
43- ### 询问模式
44-
45- ``` bash
46- # 启动询问模式
47- codeg clear --ask
25+ # 统计 src 文件夹下代码情况
26+ codeg quantity -p src
4827```
4928
50- ```
51- # 询问过程
52- 1. 请选择需要清理的文件/夹
53- ```
29+ | 选项 | 描述 |
30+ | ------------------- | ------------ |
31+ | -p, --path \< path\> | 设置代码路径 |
5432
5533### API 模式
5634
5735``` typescript
58- import { clear } from " @codegenius/clear -plugin" ;
36+ import { quantity } from " @codegenius/quantity -plugin" ;
5937
6038(async () => {
61- await clear ([ " ./dist " ] );
39+ await quantity ( " ./src " );
6240})();
63- ```
41+ ```
0 commit comments