dep-brain 0.1.0 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## Unreleased
6
-
7
- - Workspace-aware analysis for npm workspaces.
8
- - Config loading and CI policy controls.
9
- - Improved duplicate detection and unused dependency heuristics.
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## Unreleased
6
+
7
+ - Workspace-aware analysis for npm workspaces.
8
+ - Config loading and CI policy controls.
9
+ - Improved duplicate detection and unused dependency heuristics.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Vijay prakash
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vijay prakash
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,197 +1,198 @@
1
- # Dependency Brain
2
-
3
- [![npm version](https://img.shields.io/npm/v/dep-brain)](https://www.npmjs.com/package/dep-brain)
4
- [![npm downloads](https://img.shields.io/npm/dm/dep-brain)](https://www.npmjs.com/package/dep-brain)
5
- [![license](https://img.shields.io/npm/l/dep-brain)](LICENSE)
6
-
7
- `dep-brain` is a CLI and library for analyzing dependency health in JavaScript and TypeScript projects.
8
-
9
- ## Vision
10
-
11
- `npm audit + depcheck + dedupe + intelligence = one tool`
12
-
13
- ## What It Does
14
-
15
- - Detect duplicate dependencies from `package-lock.json`
16
- - Detect likely unused dependencies from source imports and scripts
17
- - Detect outdated packages
18
- - Highlight dependency risk signals
19
- - Generate a simple project health score
20
- - Output reports in human-readable or JSON format
21
-
22
- ## Current MVP Features
23
-
24
- - Duplicate dependency detection with lockfile instance tracking
25
- - Unused dependency detection with runtime vs dev-tool heuristics
26
- - Outdated dependency reporting with `major`, `minor`, and `patch` classification
27
- - Risk analysis based on npm package metadata
28
- - Config loading from `depbrain.config.json`
29
- - Ignore rules for noisy dependencies and checks
30
- - CI-friendly policy evaluation with non-zero exit codes
31
- - Workspace-aware analysis for npm workspaces
32
- - Console reporting
33
- - JSON output via `--json`
34
- - Library entrypoint for programmatic use
35
-
36
- ## CLI Usage
37
-
38
- ```bash
39
- npm install -g dep-brain
40
- dep-brain analyze
41
-
42
- npx dep-brain analyze
43
- npx dep-brain analyze --json
44
- npx dep-brain analyze ./path-to-project
45
- npx dep-brain analyze --config depbrain.config.json
46
- npx dep-brain analyze --min-score 90 --fail-on-risks
47
- npx dep-brain analyze ./path-to-project --fail-on-unused --json
48
-
49
- dep-brain config
50
- dep-brain config --config depbrain.config.json
51
-
52
- dep-brain help
53
- dep-brain analyze --help
54
- ```
55
-
56
- ## Workspaces
57
-
58
- If the root `package.json` defines `workspaces`, `dep-brain` analyzes each workspace package and reports per-package results. Aggregated counts are still shown at the top-level summary.
59
-
60
- ## Example Output
61
-
62
- ```text
63
- Project Health: 78/100
64
- Path: /your/project
65
- Policy: FAIL
66
-
67
- WARN Duplicates: 2
68
- OK Unused: 0
69
- WARN Outdated: 3
70
- OK Risks: 0
71
-
72
- Duplicate dependencies:
73
- - ansi-regex: 5.0.1, 6.0.1
74
-
75
- Outdated dependencies:
76
- - chalk: ^4.1.2 -> 5.4.1 [major]
77
-
78
- Policy reasons:
79
- - Score 78 is below minimum 90
80
-
81
- Suggestions:
82
- - Consider consolidating ansi-regex to one version
83
- - Review chalk: ^4.1.2 -> 5.4.1 (major)
84
- ```
85
-
86
- ## JSON Output
87
-
88
- ```bash
89
- dep-brain analyze --json
90
- ```
91
-
92
- ## Config File
93
-
94
- Create a `depbrain.config.json` file in the project root:
95
-
96
- ```json
97
- {
98
- "ignore": {
99
- "unused": ["eslint"],
100
- "outdated": ["typescript"]
101
- },
102
- "policy": {
103
- "minScore": 90,
104
- "failOnUnused": true,
105
- "failOnRisks": true
106
- },
107
- "report": {
108
- "maxSuggestions": 3
109
- }
110
- }
111
- ```
112
-
113
- Supported sections:
114
-
115
- - `ignore.dependencies`
116
- - `ignore.devDependencies`
117
- - `ignore.unused`
118
- - `ignore.duplicates`
119
- - `ignore.outdated`
120
- - `ignore.risks`
121
- - `policy.minScore`
122
- - `policy.failOnDuplicates`
123
- - `policy.failOnUnused`
124
- - `policy.failOnOutdated`
125
- - `policy.failOnRisks`
126
- - `report.maxSuggestions`
127
-
128
- Sample config file:
129
-
130
- - `depbrain.config.json`
131
- - `depbrain.config.schema.json`
132
-
133
- ## CI Behavior
134
-
135
- `dep-brain` now returns a non-zero exit code when configured policy checks fail.
136
-
137
- Examples:
138
-
139
- ```bash
140
- dep-brain analyze --fail-on-unused
141
- dep-brain analyze --min-score 85 --fail-on-risks
142
- dep-brain analyze --config depbrain.config.json
143
- ```
144
-
145
- ## Config Debugging
146
-
147
- Print the resolved config (after defaults and CLI overrides):
148
-
149
- ```bash
150
- dep-brain config
151
- dep-brain config --config depbrain.config.json
152
- ```
153
-
154
- ## Development
155
-
156
- ```bash
157
- npm install
158
- npm run typecheck
159
- npm run test
160
- npm run build
161
- ```
162
-
163
- ## Project Structure
164
-
165
- ```text
166
- src/
167
- |-- cli.ts
168
- |-- index.ts
169
- |-- core/
170
- | |-- analyzer.ts
171
- | |-- graph-builder.ts
172
- | `-- scorer.ts
173
- |-- checks/
174
- | |-- duplicate.ts
175
- | |-- unused.ts
176
- | |-- outdated.ts
177
- | `-- risk.ts
178
- |-- reporters/
179
- | |-- console.ts
180
- | `-- json.ts
181
- `-- utils/
182
- |-- file-parser.ts
183
- |-- npm-api.ts
184
- `-- config.ts
185
- ```
186
-
187
- ## Roadmap Direction
188
-
189
- - Improve false-positive reduction for unused dependency detection
190
- - Improve monorepo and workspace support
191
- - Strengthen risk scoring and suggestions
192
- - Add CI and GitHub Action support in later releases
193
-
194
- ## Repository Notes
195
-
196
- - Project brief: [docs/project-brief.md](./docs/project-brief.md)
197
- - Implementation history: [docs/implementation-log.md](./docs/implementation-log.md)
1
+ # Dependency Brain
2
+
3
+ [![npm version](https://img.shields.io/npm/v/dep-brain)](https://www.npmjs.com/package/dep-brain)
4
+ [![npm downloads](https://img.shields.io/npm/dm/dep-brain)](https://www.npmjs.com/package/dep-brain)
5
+ [![license](https://img.shields.io/npm/l/dep-brain)](LICENSE)
6
+
7
+ `dep-brain` is a CLI and library for analyzing dependency health in JavaScript and TypeScript projects.
8
+
9
+ ## Vision
10
+
11
+ `npm audit + depcheck + dedupe + intelligence = one tool`
12
+
13
+ ## What It Does
14
+
15
+ - Detect duplicate dependencies from `package-lock.json`
16
+ - Detect likely unused dependencies from source imports and scripts
17
+ - Detect outdated packages
18
+ - Highlight dependency risk signals
19
+ - Generate a simple project health score
20
+ - Output reports in human-readable or JSON format
21
+
22
+ ## Current MVP Features
23
+
24
+ - Duplicate dependency detection with lockfile instance tracking
25
+ - Unused dependency detection with runtime vs dev-tool heuristics
26
+ - Outdated dependency reporting with `major`, `minor`, and `patch` classification
27
+ - Risk analysis based on npm package metadata
28
+ - Config loading from `depbrain.config.json`
29
+ - Ignore rules for noisy dependencies and checks
30
+ - CI-friendly policy evaluation with non-zero exit codes
31
+ - Workspace-aware analysis for npm workspaces
32
+ - Console reporting
33
+ - JSON output via `--json`
34
+ - Library entrypoint for programmatic use
35
+
36
+ ## CLI Usage
37
+
38
+ ```bash
39
+ npm install -g dep-brain
40
+ dep-brain analyze
41
+
42
+ npx dep-brain analyze
43
+ npx dep-brain analyze --json
44
+ npx dep-brain analyze ./path-to-project
45
+ npx dep-brain analyze --config depbrain.config.json
46
+ npx dep-brain analyze --min-score 90 --fail-on-risks
47
+ npx dep-brain analyze ./path-to-project --fail-on-unused --json
48
+
49
+ dep-brain config
50
+ dep-brain config --config depbrain.config.json
51
+
52
+ dep-brain help
53
+ dep-brain analyze --help
54
+ dep-brain --version
55
+ ```
56
+
57
+ ## Workspaces
58
+
59
+ If the root `package.json` defines `workspaces`, `dep-brain` analyzes each workspace package and reports per-package results. Aggregated counts are still shown at the top-level summary.
60
+
61
+ ## Example Output
62
+
63
+ ```text
64
+ Project Health: 78/100
65
+ Path: /your/project
66
+ Policy: FAIL
67
+
68
+ WARN Duplicates: 2
69
+ OK Unused: 0
70
+ WARN Outdated: 3
71
+ OK Risks: 0
72
+
73
+ Duplicate dependencies:
74
+ - ansi-regex: 5.0.1, 6.0.1
75
+
76
+ Outdated dependencies:
77
+ - chalk: ^4.1.2 -> 5.4.1 [major]
78
+
79
+ Policy reasons:
80
+ - Score 78 is below minimum 90
81
+
82
+ Suggestions:
83
+ - Consider consolidating ansi-regex to one version
84
+ - Review chalk: ^4.1.2 -> 5.4.1 (major)
85
+ ```
86
+
87
+ ## JSON Output
88
+
89
+ ```bash
90
+ dep-brain analyze --json
91
+ ```
92
+
93
+ ## Config File
94
+
95
+ Create a `depbrain.config.json` file in the project root:
96
+
97
+ ```json
98
+ {
99
+ "ignore": {
100
+ "unused": ["eslint"],
101
+ "outdated": ["typescript"]
102
+ },
103
+ "policy": {
104
+ "minScore": 90,
105
+ "failOnUnused": true,
106
+ "failOnRisks": true
107
+ },
108
+ "report": {
109
+ "maxSuggestions": 3
110
+ }
111
+ }
112
+ ```
113
+
114
+ Supported sections:
115
+
116
+ - `ignore.dependencies`
117
+ - `ignore.devDependencies`
118
+ - `ignore.unused`
119
+ - `ignore.duplicates`
120
+ - `ignore.outdated`
121
+ - `ignore.risks`
122
+ - `policy.minScore`
123
+ - `policy.failOnDuplicates`
124
+ - `policy.failOnUnused`
125
+ - `policy.failOnOutdated`
126
+ - `policy.failOnRisks`
127
+ - `report.maxSuggestions`
128
+
129
+ Sample config file:
130
+
131
+ - `depbrain.config.json`
132
+ - `depbrain.config.schema.json`
133
+
134
+ ## CI Behavior
135
+
136
+ `dep-brain` now returns a non-zero exit code when configured policy checks fail.
137
+
138
+ Examples:
139
+
140
+ ```bash
141
+ dep-brain analyze --fail-on-unused
142
+ dep-brain analyze --min-score 85 --fail-on-risks
143
+ dep-brain analyze --config depbrain.config.json
144
+ ```
145
+
146
+ ## Config Debugging
147
+
148
+ Print the resolved config (after defaults and CLI overrides):
149
+
150
+ ```bash
151
+ dep-brain config
152
+ dep-brain config --config depbrain.config.json
153
+ ```
154
+
155
+ ## Development
156
+
157
+ ```bash
158
+ npm install
159
+ npm run typecheck
160
+ npm run test
161
+ npm run build
162
+ ```
163
+
164
+ ## Project Structure
165
+
166
+ ```text
167
+ src/
168
+ |-- cli.ts
169
+ |-- index.ts
170
+ |-- core/
171
+ | |-- analyzer.ts
172
+ | |-- graph-builder.ts
173
+ | `-- scorer.ts
174
+ |-- checks/
175
+ | |-- duplicate.ts
176
+ | |-- unused.ts
177
+ | |-- outdated.ts
178
+ | `-- risk.ts
179
+ |-- reporters/
180
+ | |-- console.ts
181
+ | `-- json.ts
182
+ `-- utils/
183
+ |-- file-parser.ts
184
+ |-- npm-api.ts
185
+ `-- config.ts
186
+ ```
187
+
188
+ ## Roadmap Direction
189
+
190
+ - Improve false-positive reduction for unused dependency detection
191
+ - Improve monorepo and workspace support
192
+ - Strengthen risk scoring and suggestions
193
+ - Add CI and GitHub Action support in later releases
194
+
195
+ ## Repository Notes
196
+
197
+ - Project brief: [docs/project-brief.md](./docs/project-brief.md)
198
+ - Implementation history: [docs/implementation-log.md](./docs/implementation-log.md)
@@ -1,20 +1,20 @@
1
- {
2
- "ignore": {
3
- "unused": [],
4
- "outdated": [],
5
- "duplicates": [],
6
- "risks": [],
7
- "dependencies": [],
8
- "devDependencies": []
9
- },
10
- "policy": {
11
- "minScore": 85,
12
- "failOnUnused": false,
13
- "failOnOutdated": false,
14
- "failOnDuplicates": false,
15
- "failOnRisks": false
16
- },
17
- "report": {
18
- "maxSuggestions": 5
19
- }
20
- }
1
+ {
2
+ "ignore": {
3
+ "unused": [],
4
+ "outdated": [],
5
+ "duplicates": [],
6
+ "risks": [],
7
+ "dependencies": [],
8
+ "devDependencies": []
9
+ },
10
+ "policy": {
11
+ "minScore": 85,
12
+ "failOnUnused": false,
13
+ "failOnOutdated": false,
14
+ "failOnDuplicates": false,
15
+ "failOnRisks": false
16
+ },
17
+ "report": {
18
+ "maxSuggestions": 5
19
+ }
20
+ }
@@ -1,38 +1,38 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "title": "Dependency Brain Config",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "properties": {
7
- "ignore": {
8
- "type": "object",
9
- "additionalProperties": false,
10
- "properties": {
11
- "dependencies": { "type": "array", "items": { "type": "string" } },
12
- "devDependencies": { "type": "array", "items": { "type": "string" } },
13
- "unused": { "type": "array", "items": { "type": "string" } },
14
- "duplicates": { "type": "array", "items": { "type": "string" } },
15
- "outdated": { "type": "array", "items": { "type": "string" } },
16
- "risks": { "type": "array", "items": { "type": "string" } }
17
- }
18
- },
19
- "policy": {
20
- "type": "object",
21
- "additionalProperties": false,
22
- "properties": {
23
- "minScore": { "type": "number" },
24
- "failOnUnused": { "type": "boolean" },
25
- "failOnOutdated": { "type": "boolean" },
26
- "failOnDuplicates": { "type": "boolean" },
27
- "failOnRisks": { "type": "boolean" }
28
- }
29
- },
30
- "report": {
31
- "type": "object",
32
- "additionalProperties": false,
33
- "properties": {
34
- "maxSuggestions": { "type": "number" }
35
- }
36
- }
37
- }
38
- }
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Dependency Brain Config",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "properties": {
7
+ "ignore": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "dependencies": { "type": "array", "items": { "type": "string" } },
12
+ "devDependencies": { "type": "array", "items": { "type": "string" } },
13
+ "unused": { "type": "array", "items": { "type": "string" } },
14
+ "duplicates": { "type": "array", "items": { "type": "string" } },
15
+ "outdated": { "type": "array", "items": { "type": "string" } },
16
+ "risks": { "type": "array", "items": { "type": "string" } }
17
+ }
18
+ },
19
+ "policy": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "properties": {
23
+ "minScore": { "type": "number" },
24
+ "failOnUnused": { "type": "boolean" },
25
+ "failOnOutdated": { "type": "boolean" },
26
+ "failOnDuplicates": { "type": "boolean" },
27
+ "failOnRisks": { "type": "boolean" }
28
+ }
29
+ },
30
+ "report": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "properties": {
34
+ "maxSuggestions": { "type": "number" }
35
+ }
36
+ }
37
+ }
38
+ }
package/dist/cli.js CHANGED
@@ -6,11 +6,13 @@ import { promises as fs } from "node:fs";
6
6
  import path from "node:path";
7
7
  async function main() {
8
8
  const args = process.argv.slice(2);
9
- const command = args[0] ?? "analyze";
9
+ const firstArg = args[0];
10
+ const command = firstArg && !firstArg.startsWith("--") ? firstArg : "analyze";
10
11
  const optionValues = new Map();
11
12
  const flags = new Set();
12
13
  const positionals = [];
13
- for (let index = 1; index < args.length; index += 1) {
14
+ const startIndex = firstArg && !firstArg.startsWith("--") ? 1 : 0;
15
+ for (let index = startIndex; index < args.length; index += 1) {
14
16
  const value = args[index];
15
17
  if (!value?.startsWith("--")) {
16
18
  positionals.push(value);
@@ -30,6 +32,11 @@ async function main() {
30
32
  printHelp();
31
33
  return;
32
34
  }
35
+ if (flags.has("--version")) {
36
+ const version = await loadPackageVersion();
37
+ console.log(version ?? "unknown");
38
+ return;
39
+ }
33
40
  if (command !== "analyze") {
34
41
  if (command === "config") {
35
42
  if (!(await hasPackageJson(targetPath))) {
@@ -37,13 +44,21 @@ async function main() {
37
44
  process.exitCode = 1;
38
45
  return;
39
46
  }
40
- const config = await analyzeProject({
41
- rootDir: targetPath,
42
- configPath: optionValues.get("--config"),
43
- config: buildCliConfig(flags, optionValues)
44
- });
45
- console.log(JSON.stringify(config.config, null, 2));
46
- return;
47
+ try {
48
+ const config = await analyzeProject({
49
+ rootDir: targetPath,
50
+ configPath: optionValues.get("--config"),
51
+ config: buildCliConfig(flags, optionValues)
52
+ });
53
+ console.log(JSON.stringify(config.config, null, 2));
54
+ return;
55
+ }
56
+ catch (error) {
57
+ console.error("Failed to resolve config.");
58
+ console.error(error);
59
+ process.exitCode = 1;
60
+ return;
61
+ }
47
62
  }
48
63
  console.error(`Unknown command: ${command}`);
49
64
  printHelp();
@@ -55,14 +70,21 @@ async function main() {
55
70
  process.exitCode = 1;
56
71
  return;
57
72
  }
58
- const cliConfig = buildCliConfig(flags, optionValues);
59
- const result = await analyzeProject({
60
- rootDir: targetPath,
61
- configPath: optionValues.get("--config"),
62
- config: cliConfig
63
- });
64
- console.log(flags.has("--json") ? renderJsonReport(result) : renderConsoleReport(result));
65
- if (!result.policy.passed) {
73
+ try {
74
+ const cliConfig = buildCliConfig(flags, optionValues);
75
+ const result = await analyzeProject({
76
+ rootDir: targetPath,
77
+ configPath: optionValues.get("--config"),
78
+ config: cliConfig
79
+ });
80
+ console.log(flags.has("--json") ? renderJsonReport(result) : renderConsoleReport(result));
81
+ if (!result.policy.passed) {
82
+ process.exitCode = 1;
83
+ }
84
+ }
85
+ catch (error) {
86
+ console.error("Analysis failed.");
87
+ console.error(error);
66
88
  process.exitCode = 1;
67
89
  }
68
90
  }
@@ -105,6 +127,7 @@ function printHelp() {
105
127
  console.log(" dep-brain analyze [path] [--json] [--config path] [--min-score n] [--fail-on-risks] [--fail-on-outdated] [--fail-on-unused] [--fail-on-duplicates]");
106
128
  console.log(" dep-brain config [path] [--config path]");
107
129
  console.log(" dep-brain help");
130
+ console.log(" dep-brain --version");
108
131
  console.log("");
109
132
  console.log("Options:");
110
133
  console.log(" --json Output JSON for analysis");
@@ -115,4 +138,16 @@ function printHelp() {
115
138
  console.log(" --fail-on-unused Fail when unused dependencies exist");
116
139
  console.log(" --fail-on-duplicates Fail when duplicates exist");
117
140
  console.log(" --help Show this help output");
141
+ console.log(" --version Show CLI version");
142
+ }
143
+ async function loadPackageVersion() {
144
+ try {
145
+ const pkgPath = new URL("../package.json", import.meta.url);
146
+ const content = await fs.readFile(pkgPath, "utf8");
147
+ const pkg = JSON.parse(content);
148
+ return pkg.version ?? null;
149
+ }
150
+ catch {
151
+ return null;
152
+ }
118
153
  }
package/package.json CHANGED
@@ -1,53 +1,53 @@
1
- {
2
- "name": "dep-brain",
3
- "version": "0.1.0",
4
- "description": "CLI and library for dependency health analysis",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "bin": {
9
- "dep-brain": "dist/cli.js"
10
- },
11
- "files": [
12
- "dist",
13
- "README.md",
14
- "LICENSE",
15
- "CHANGELOG.md",
16
- "depbrain.config.json",
17
- "depbrain.config.schema.json"
18
- ],
19
- "scripts": {
20
- "build": "tsc -p tsconfig.json",
21
- "clean": "if exist dist rmdir /s /q dist",
22
- "dev": "tsx src/cli.ts analyze",
23
- "start": "node dist/cli.js analyze",
24
- "test": "npm run build && node tests/run.js",
25
- "typecheck": "tsc -p tsconfig.json --noEmit"
26
- },
27
- "keywords": [
28
- "dependencies",
29
- "cli",
30
- "analysis",
31
- "npm",
32
- "audit"
33
- ],
34
- "author": "",
35
- "license": "MIT",
36
- "repository": {
37
- "type": "git",
38
- "url": "git+ssh://git@github.com/prakashu51/dep-brain.git"
39
- },
40
- "bugs": {
41
- "url": "https://github.com/prakashu51/dep-brain/issues"
42
- },
43
- "homepage": "https://github.com/prakashu51/dep-brain#readme",
44
- "engines": {
45
- "node": ">=18"
46
- },
47
- "dependencies": {},
48
- "devDependencies": {
49
- "@types/node": "^24.5.2",
50
- "tsx": "^4.20.5",
51
- "typescript": "^5.9.2"
52
- }
53
- }
1
+ {
2
+ "name": "dep-brain",
3
+ "version": "0.1.2",
4
+ "description": "CLI and library for dependency health analysis",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "dep-brain": "dist/cli.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "README.md",
14
+ "LICENSE",
15
+ "CHANGELOG.md",
16
+ "depbrain.config.json",
17
+ "depbrain.config.schema.json"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc -p tsconfig.json",
21
+ "clean": "if exist dist rmdir /s /q dist",
22
+ "dev": "tsx src/cli.ts analyze",
23
+ "start": "node dist/cli.js analyze",
24
+ "test": "npm run build && node tests/run.js",
25
+ "typecheck": "tsc -p tsconfig.json --noEmit"
26
+ },
27
+ "keywords": [
28
+ "dependencies",
29
+ "cli",
30
+ "analysis",
31
+ "npm",
32
+ "audit"
33
+ ],
34
+ "author": "",
35
+ "license": "MIT",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+ssh://git@github.com/prakashu51/dep-brain.git"
39
+ },
40
+ "bugs": {
41
+ "url": "https://github.com/prakashu51/dep-brain/issues"
42
+ },
43
+ "homepage": "https://github.com/prakashu51/dep-brain#readme",
44
+ "engines": {
45
+ "node": ">=18"
46
+ },
47
+ "dependencies": {},
48
+ "devDependencies": {
49
+ "@types/node": "^24.5.2",
50
+ "tsx": "^4.20.5",
51
+ "typescript": "^5.9.2"
52
+ }
53
+ }