dir-analysis-tool 2.0.7 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +390 -198
- package/dist/cli.js +882 -0
- package/dist/index.d.ts +539 -0
- package/dist/index.js +1 -1310
- package/dist/shared-Cmryy0SH.js +3351 -0
- package/package.json +75 -49
- package/schema.json +176 -0
package/package.json
CHANGED
|
@@ -1,48 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dir-analysis-tool",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Fast, memory-bounded directory analysis for your terminal and CI: largest folders and files, type and extension breakdowns, staged duplicate detection, size budgets, directory diffs, and self-contained HTML, Markdown, JSON, and CSV reports.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./schema.json": "./schema.json",
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
7
16
|
"bin": {
|
|
8
|
-
"dat": "dist/
|
|
9
|
-
"dir-analysis-tool": "dist/
|
|
17
|
+
"dat": "dist/cli.js",
|
|
18
|
+
"dir-analysis-tool": "dist/cli.js"
|
|
10
19
|
},
|
|
11
20
|
"files": [
|
|
12
|
-
"dist
|
|
13
|
-
"
|
|
14
|
-
"LICENSE"
|
|
21
|
+
"dist",
|
|
22
|
+
"schema.json"
|
|
15
23
|
],
|
|
24
|
+
"sideEffects": false,
|
|
16
25
|
"scripts": {
|
|
17
|
-
"build": "
|
|
18
|
-
"dev": "
|
|
26
|
+
"build": "tsdown",
|
|
27
|
+
"dev": "node src/cli/main.ts",
|
|
19
28
|
"typecheck": "tsc --noEmit",
|
|
20
|
-
"lint": "
|
|
21
|
-
"lint:fix": "
|
|
22
|
-
"format": "prettier --write
|
|
23
|
-
"format:check": "prettier --check
|
|
24
|
-
"
|
|
25
|
-
"
|
|
29
|
+
"lint": "oxlint --type-aware --deny-warnings",
|
|
30
|
+
"lint:fix": "oxlint --type-aware --fix",
|
|
31
|
+
"format": "prettier --write .",
|
|
32
|
+
"format:check": "prettier --check .",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"test:watch": "vitest",
|
|
35
|
+
"test:coverage": "vitest run --coverage",
|
|
36
|
+
"schema": "node scripts/generate-schema.ts",
|
|
37
|
+
"bench": "node scripts/bench.ts",
|
|
38
|
+
"check": "pnpm typecheck && pnpm lint && pnpm format:check && pnpm build && pnpm test:coverage && pnpm check:package",
|
|
39
|
+
"check:package": "publint --strict && attw --pack . --profile esm-only",
|
|
40
|
+
"prepare": "husky",
|
|
41
|
+
"prepublishOnly": "pnpm build"
|
|
26
42
|
},
|
|
27
43
|
"keywords": [
|
|
28
44
|
"cli",
|
|
29
45
|
"directory",
|
|
30
46
|
"analyzer",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"disk-
|
|
47
|
+
"disk-usage",
|
|
48
|
+
"du",
|
|
49
|
+
"disk-space",
|
|
50
|
+
"duplicate-files",
|
|
34
51
|
"duplicate-detection",
|
|
52
|
+
"large-files",
|
|
35
53
|
"file-classification",
|
|
36
54
|
"storage-audit",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
55
|
+
"size-budget",
|
|
56
|
+
"directory-diff",
|
|
57
|
+
"html-report",
|
|
58
|
+
"markdown-report",
|
|
41
59
|
"csv-export",
|
|
42
|
-
"
|
|
60
|
+
"gitignore",
|
|
43
61
|
"cross-platform"
|
|
44
62
|
],
|
|
45
|
-
"author":
|
|
63
|
+
"author": {
|
|
64
|
+
"name": "Khaled Saeed",
|
|
65
|
+
"url": "https://github.com/KhaledSaeed18"
|
|
66
|
+
},
|
|
46
67
|
"license": "MIT",
|
|
47
68
|
"repository": {
|
|
48
69
|
"type": "git",
|
|
@@ -53,34 +74,39 @@
|
|
|
53
74
|
},
|
|
54
75
|
"homepage": "https://github.com/KhaledSaeed18/dir-analysis-tool#readme",
|
|
55
76
|
"dependencies": {
|
|
56
|
-
"@clack/prompts": "^1.
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"commander": "^14.0.3",
|
|
60
|
-
"pretty-bytes": "^7.1.0",
|
|
61
|
-
"zod": "^4.3.6"
|
|
77
|
+
"@clack/prompts": "^1.8.1",
|
|
78
|
+
"commander": "^15.0.0",
|
|
79
|
+
"ignore": "^7.0.12"
|
|
62
80
|
},
|
|
63
81
|
"devDependencies": {
|
|
64
|
-
"@
|
|
65
|
-
"@commitlint/
|
|
66
|
-
"@
|
|
67
|
-
"@semantic-release/changelog": "^
|
|
82
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
83
|
+
"@commitlint/cli": "^21.2.4",
|
|
84
|
+
"@commitlint/config-conventional": "^21.2.4",
|
|
85
|
+
"@semantic-release/changelog": "^7.0.0",
|
|
68
86
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
69
|
-
"@semantic-release/git": "^
|
|
70
|
-
"@semantic-release/github": "^12.0.
|
|
71
|
-
"@semantic-release/npm": "^13.
|
|
72
|
-
"@semantic-release/release-notes-generator": "^14.1.
|
|
73
|
-
"@types/node": "
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
87
|
+
"@semantic-release/git": "^11.0.1",
|
|
88
|
+
"@semantic-release/github": "^12.0.10",
|
|
89
|
+
"@semantic-release/npm": "^13.2.0",
|
|
90
|
+
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
91
|
+
"@types/node": "^22.20.5",
|
|
92
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
93
|
+
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
94
|
+
"husky": "^9.1.7",
|
|
95
|
+
"oxlint": "^1.88.0",
|
|
96
|
+
"oxlint-tsgolint": "^7.0.2004",
|
|
97
|
+
"prettier": "^3.9.10",
|
|
98
|
+
"publint": "^0.3.25",
|
|
99
|
+
"semantic-release": "^25.0.9",
|
|
100
|
+
"tsdown": "^0.23.1",
|
|
101
|
+
"typescript": "^7.0.2",
|
|
102
|
+
"vitest": "^5.0.5"
|
|
82
103
|
},
|
|
83
104
|
"engines": {
|
|
84
|
-
"node": ">=
|
|
105
|
+
"node": ">=22.12.0"
|
|
106
|
+
},
|
|
107
|
+
"packageManager": "pnpm@12.14.0",
|
|
108
|
+
"publishConfig": {
|
|
109
|
+
"access": "public",
|
|
110
|
+
"provenance": true
|
|
85
111
|
}
|
|
86
112
|
}
|
package/schema.json
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unpkg.com/dir-analysis-tool/schema.json",
|
|
4
|
+
"title": "dir-analysis-tool configuration",
|
|
5
|
+
"description": "Configuration for dir-analysis-tool (dat). Place it in .dir-analyzer.json or dir-analyzer.config.json.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "JSON Schema reference for editor support."
|
|
12
|
+
},
|
|
13
|
+
"exclude": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"items": {
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"description": "Gitignore-style patterns to skip, relative to the analyzed directory.",
|
|
19
|
+
"examples": [
|
|
20
|
+
[
|
|
21
|
+
"*.log",
|
|
22
|
+
"coverage/",
|
|
23
|
+
"docs/**/*.pdf"
|
|
24
|
+
]
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"defaultExcludes": {
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"description": "Skip .git, .hg, .svn, and node_modules. Default: true."
|
|
30
|
+
},
|
|
31
|
+
"gitignore": {
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"description": "Honor .gitignore files. Default: false."
|
|
34
|
+
},
|
|
35
|
+
"maxDepth": {
|
|
36
|
+
"type": "integer",
|
|
37
|
+
"minimum": 0,
|
|
38
|
+
"description": "Directory levels to descend; 0 scans only the top-level files. Default: unlimited."
|
|
39
|
+
},
|
|
40
|
+
"followSymlinks": {
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"description": "Follow symbolic links (cycles are detected). Default: false."
|
|
43
|
+
},
|
|
44
|
+
"countHardlinks": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"description": "Count every hard link separately instead of counting shared data once. Default: false."
|
|
47
|
+
},
|
|
48
|
+
"minSize": {
|
|
49
|
+
"anyOf": [
|
|
50
|
+
{
|
|
51
|
+
"type": "integer",
|
|
52
|
+
"minimum": 0
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "string",
|
|
56
|
+
"pattern": "^\\s*(\\d+(\\.\\d+)?|\\.\\d+)\\s*([kKmMgGtTpP]([iI]?[bB])?|[bB])?\\s*$"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"description": "Only include files at least this large. Bytes, or a size such as \"512k\", \"25MiB\", or \"1GB\"."
|
|
60
|
+
},
|
|
61
|
+
"maxSize": {
|
|
62
|
+
"anyOf": [
|
|
63
|
+
{
|
|
64
|
+
"type": "integer",
|
|
65
|
+
"minimum": 0
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"type": "string",
|
|
69
|
+
"pattern": "^\\s*(\\d+(\\.\\d+)?|\\.\\d+)\\s*([kKmMgGtTpP]([iI]?[bB])?|[bB])?\\s*$"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"description": "Only include files at most this large. Bytes, or a size such as \"512k\", \"25MiB\", or \"1GB\"."
|
|
73
|
+
},
|
|
74
|
+
"newerThan": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "Only include files modified after this point. An age such as \"30d\", \"6mo\", or \"1y\", or a date (YYYY-MM-DD)."
|
|
77
|
+
},
|
|
78
|
+
"olderThan": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "Only include files modified before this point. An age such as \"30d\", \"6mo\", or \"1y\", or a date (YYYY-MM-DD)."
|
|
81
|
+
},
|
|
82
|
+
"top": {
|
|
83
|
+
"type": "integer",
|
|
84
|
+
"minimum": 0,
|
|
85
|
+
"description": "Length of the largest files and folders lists; 0 hides them. Default: 10."
|
|
86
|
+
},
|
|
87
|
+
"largeFiles": {
|
|
88
|
+
"anyOf": [
|
|
89
|
+
{
|
|
90
|
+
"type": "boolean"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "integer",
|
|
94
|
+
"minimum": 0
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"type": "string",
|
|
98
|
+
"pattern": "^\\s*(\\d+(\\.\\d+)?|\\.\\d+)\\s*([kKmMgGtTpP]([iI]?[bB])?|[bB])?\\s*$"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"description": "Report files at least this large; true uses 100 MiB. Bytes, or a size such as \"512k\", \"25MiB\", or \"1GB\".",
|
|
102
|
+
"examples": [
|
|
103
|
+
"50MB"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"duplicates": {
|
|
107
|
+
"type": "boolean",
|
|
108
|
+
"description": "Find files with identical contents."
|
|
109
|
+
},
|
|
110
|
+
"minDuplicateSize": {
|
|
111
|
+
"anyOf": [
|
|
112
|
+
{
|
|
113
|
+
"type": "integer",
|
|
114
|
+
"minimum": 0
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"type": "string",
|
|
118
|
+
"pattern": "^\\s*(\\d+(\\.\\d+)?|\\.\\d+)\\s*([kKmMgGtTpP]([iI]?[bB])?|[bB])?\\s*$"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"description": "Ignore files smaller than this when looking for duplicates. Bytes, or a size such as \"512k\", \"25MiB\", or \"1GB\"."
|
|
122
|
+
},
|
|
123
|
+
"empty": {
|
|
124
|
+
"type": "boolean",
|
|
125
|
+
"description": "Report empty files and empty folders."
|
|
126
|
+
},
|
|
127
|
+
"stale": {
|
|
128
|
+
"anyOf": [
|
|
129
|
+
{
|
|
130
|
+
"type": "boolean"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"type": "string"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"description": "Report files not modified since this point; true uses one year. An age such as \"30d\", \"6mo\", or \"1y\", or a date (YYYY-MM-DD).",
|
|
137
|
+
"examples": [
|
|
138
|
+
"2y"
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
"extensions": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"description": "Show the extension breakdown."
|
|
144
|
+
},
|
|
145
|
+
"tree": {
|
|
146
|
+
"type": "boolean",
|
|
147
|
+
"description": "Show a size tree."
|
|
148
|
+
},
|
|
149
|
+
"treeDepth": {
|
|
150
|
+
"type": "integer",
|
|
151
|
+
"minimum": 1,
|
|
152
|
+
"description": "Levels shown by the tree. Default: 3."
|
|
153
|
+
},
|
|
154
|
+
"units": {
|
|
155
|
+
"enum": [
|
|
156
|
+
"iec",
|
|
157
|
+
"si"
|
|
158
|
+
],
|
|
159
|
+
"description": "Size units: \"iec\" (KiB, MiB; powers of 1024) or \"si\" (kB, MB; powers of 1000)."
|
|
160
|
+
},
|
|
161
|
+
"budgets": {
|
|
162
|
+
"type": "array",
|
|
163
|
+
"items": {
|
|
164
|
+
"type": "string"
|
|
165
|
+
},
|
|
166
|
+
"description": "Rules that must hold, or the run exits with code 2. Metrics: size, disk, files, dirs, largest, large, duplicates, wasted, empty, stale, errors.",
|
|
167
|
+
"examples": [
|
|
168
|
+
[
|
|
169
|
+
"size<=500MB",
|
|
170
|
+
"duplicates=0",
|
|
171
|
+
"largest<50MB"
|
|
172
|
+
]
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|