{"_id":"@blacnova/dep-insight","_rev":"3-ec226bbba10249db444ac9f7a23fabae","name":"@blacnova/dep-insight","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@blacnova/dep-insight","version":"1.0.0","keywords":["dependency","graph","visualization","impact-analysis","circular-dependency","dependency-health"],"license":"MIT","_id":"@blacnova/dep-insight@1.0.0","maintainers":[{"name":"nicholasxdavis","email":"nic@blacnova.net"}],"homepage":"https://github.com/cenfun/dep-insight#readme","bugs":{"url":"https://github.com/cenfun/dep-insight/issues"},"dist":{"shasum":"4a5a2c930b5d4313a2e6511e70d5a8bae7ebfe53","tarball":"https://registry.npmjs.org/@blacnova/dep-insight/-/dep-insight-1.0.0.tgz","fileCount":12,"integrity":"sha512-boLegwpTjygG6Fl2UNnYRD51xcDmptLxhl6mLkriXIZwH4RLj0e5A8dEg4fnD3A0qyIG0LSNzhNcogyk3qiNdA==","signatures":[{"sig":"MEYCIQC7szRPAgKSYd/kocP/TZ599BkcJMQJxOu5dsyucy5K3AIhAMjlDNzrP/3vS4vit2JzXVrjXYIIu8Mgm2Xz9Xktglc7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":91931},"main":"./lib/index.js","types":"./lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.mjs","default":"./lib/index.js","require":"./lib/index.js"},"./package.json":"./package.json"},"scripts":{"link":"sf link ./ -f","test":"node ./scripts/test.mjs","build":"node ./scripts/build.mjs","patch":"npm run test && npm run build && sf publish patch -r"},"_npmUser":{"name":"nicholasxdavis","email":"nic@blacnova.net"},"repository":{"url":"git+https://github.com/cenfun/dep-insight.git","type":"git"},"_npmVersion":"10.2.0","description":"Interactive dependency visualization and impact analysis for JavaScript projects","directories":{},"_nodeVersion":"25.6.1","dependencies":{"acorn":"^8.16.0","console-grid":"^2.2.4","eight-colors":"^1.3.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^10.2.0","eslint-config-plus":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dep-insight_1.0.0_1784081503040_0.9969315726448165","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@blacnova/dep-insight","version":"1.0.1","keywords":["dependency","graph","visualization","impact-analysis","circular-dependency","dependency-health"],"license":"MIT","_id":"@blacnova/dep-insight@1.0.1","maintainers":[{"name":"nicholasxdavis","email":"nic@blacnova.net"}],"homepage":"https://github.com/nicholasxdavis/dep-insight#readme","bugs":{"url":"https://github.com/nicholasxdavis/dep-insight/issues"},"dist":{"shasum":"c23e9cc88ae40e2955189302d02ba1bfae29455c","tarball":"https://registry.npmjs.org/@blacnova/dep-insight/-/dep-insight-1.0.1.tgz","fileCount":12,"integrity":"sha512-fv/+ALCY2HAqSBCBbWhOXEwK85KNP5i23VxGtttM7CnlZr6z5RNoCTDoGNr9w79nJKNkPOZW0JX5oeIYg/DBmg==","signatures":[{"sig":"MEQCIBbyW8n8Ml9jSMQYI3E+p60keO5/dD/9Rr3F5TQd8FoBAiAmp/Vrk9VWqmRQ+epJqPq8jM4Ox90pZkW8eFvE1pgojA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":92222},"main":"./lib/index.js","types":"./lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.mjs","default":"./lib/index.js","require":"./lib/index.js"},"./package.json":"./package.json"},"scripts":{"link":"sf link ./ -f","test":"node ./scripts/test.mjs","build":"node ./scripts/build.mjs","patch":"npm run test && npm run build && sf publish patch -r"},"_npmUser":{"name":"nicholasxdavis","email":"nic@blacnova.net"},"repository":{"url":"git+https://github.com/nicholasxdavis/dep-insight.git","type":"git"},"_npmVersion":"10.2.0","description":"Interactive dependency visualization and impact analysis for JavaScript projects","directories":{},"_nodeVersion":"25.6.1","dependencies":{"acorn":"^8.16.0","console-grid":"^2.2.4","eight-colors":"^1.3.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^10.2.0","eslint-config-plus":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/dep-insight_1.0.1_1784081643238_0.9920517448303865","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@blacnova/dep-insight","version":"1.0.2","description":"Interactive dependency visualization and impact analysis for JavaScript projects","main":"./lib/index.js","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.mjs","require":"./lib/index.js","default":"./lib/index.js"},"./package.json":"./package.json"},"types":"./lib/index.d.ts","scripts":{"test":"node ./scripts/test.mjs","link":"sf link ./ -f","build":"node ./scripts/build.mjs","patch":"npm run test && npm run build && sf publish patch -r"},"keywords":["dependency","graph","visualization","impact-analysis","circular-dependency","dependency-health"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/nicholasxdavis/dep-insight.git"},"bugs":{"url":"https://github.com/nicholasxdavis/dep-insight/issues"},"homepage":"https://github.com/nicholasxdavis/dep-insight#readme","dependencies":{"acorn":"^8.16.0","console-grid":"^2.2.4","eight-colors":"^1.3.3"},"devDependencies":{"eslint":"^10.2.0","eslint-config-plus":"^2.0.4"},"_id":"@blacnova/dep-insight@1.0.2","gitHead":"6fbb97408b8b8bd243276fe0e0162a35b958672d","_nodeVersion":"25.6.1","_npmVersion":"10.2.0","dist":{"integrity":"sha512-Rq1TVwo/pa2xHcfQnxGzRwGdmpwXq3+/4Ynovm1+sDySkfhzbhYmVt49rbJb6ZRHI6y9YyQ4KjaWz8LQKcZnFw==","shasum":"e10bf662754a6ffe8eceac304fcbf14270c73206","tarball":"https://registry.npmjs.org/@blacnova/dep-insight/-/dep-insight-1.0.2.tgz","fileCount":12,"unpackedSize":92222,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIC7BwWL3pWE3Tvb5RPLZPMdu8cAiCD8rzDxTd+pbbRmkAiEAzyShDMrTgsLwlzfIJsW9eOm3ylEt4v8VG93NA3hyQpM="}]},"_npmUser":{"name":"nicholasxdavis","email":"nic@blacnova.net"},"directories":{},"maintainers":[{"name":"nicholasxdavis","email":"nic@blacnova.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dep-insight_1.0.2_1784081708211_0.7430900654536239"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-15T02:11:42.841Z","modified":"2026-07-15T02:15:08.481Z","1.0.0":"2026-07-15T02:11:43.180Z","1.0.1":"2026-07-15T02:14:03.382Z","1.0.2":"2026-07-15T02:15:08.345Z"},"bugs":{"url":"https://github.com/nicholasxdavis/dep-insight/issues"},"license":"MIT","homepage":"https://github.com/nicholasxdavis/dep-insight#readme","keywords":["dependency","graph","visualization","impact-analysis","circular-dependency","dependency-health"],"repository":{"type":"git","url":"git+https://github.com/nicholasxdavis/dep-insight.git"},"description":"Interactive dependency visualization and impact analysis for JavaScript projects","maintainers":[{"name":"nicholasxdavis","email":"nic@blacnova.net"}],"readme":"# @blacnova/dep-insight\n\n![](https://img.shields.io/npm/v/@blacnova/dep-insight.svg)\n![](https://img.shields.io/npm/dt/@blacnova/dep-insight.svg)\n\n> Interactive dependency visualization and impact analysis for JavaScript projects.\n\n## Features\n* Build dependency graphs from package.json and ES6 imports\n* Detect circular dependencies\n* Impact analysis: \"if I change this file, what breaks?\"\n* Dependency health scoring (outdated, unmaintained packages)\n* Interactive console visualization with console-grid\n* Interactive HTML visualization with impact analysis\n* Zero runtime dependencies (except acorn for parsing)\n* TypeScript support\n* ESM and CommonJS dual format\n\n## Install\n```\nnpm i @blacnova/dep-insight\n```\n\n## Usage\n\n### CommonJS\n```js\nconst DepInsight = require(\"@blacnova/dep-insight\");\n```\n\n### ESM\n```js\nimport DepInsight from \"@blacnova/dep-insight\";\n// or\nimport DepInsight, { DepInsight as DepInsightClass } from \"@blacnova/dep-insight\";\n```\n\n## Examples\n\n### Basic Analysis\n```js\nconst DepInsight = require(\"@blacnova/dep-insight\");\n\nconst di = new DepInsight({\n    rootDir: './my-project',\n    includeDev: false,\n    includePeer: false\n});\n\n// Build the dependency graph\nawait di.build();\n\n// Detect circular dependencies\nconst circular = di.detectCircular();\nconsole.log(`Found ${circular.length} circular dependencies`);\n\n// Score dependency health\nconst healthScores = await di.scoreHealth();\n\n// Generate console report\ndi.reportConsole();\n```\n\n### Impact Analysis\n```js\nconst DepInsight = require(\"@blacnova/dep-insight\");\n\nconst di = new DepInsight();\nawait di.build();\n\n// Analyze impact of changing a specific file\nconst impact = di.analyzeImpact('src/utils/helpers.js');\n\nconsole.log(`Impact Level: ${impact.impact.level}`);\nconsole.log(`Direct Dependents: ${impact.directDependents.length}`);\nconsole.log(`Transitive Dependents: ${impact.transitiveDependents.length}`);\nconsole.log('Recommendations:', impact.recommendations);\n```\n\n### Generate HTML Report\n```js\nconst DepInsight = require(\"@blacnova/dep-insight\");\n\nconst di = new DepInsight();\nawait di.build();\ndi.detectCircular();\nawait di.scoreHealth();\n\n// Generate interactive HTML report\nconst reportPath = await di.reportHtml('./dependency-report.html');\nconsole.log(`Report generated: ${reportPath}`);\n```\n\n### Complete Analysis\n```js\nconst DepInsight = require(\"@blacnova/dep-insight\");\n\nconst di = new DepInsight();\n\n// Run complete analysis\nconst results = await di.analyze();\n\nconsole.log('Graph:', results.graph);\nconsole.log('Circular Dependencies:', results.circularDependencies);\nconsole.log('Health Scores:', results.healthScores);\n```\n\n## API\n\n### `new DepInsight(options)`\nCreates a new DepInsight instance.\n\n#### Options\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `rootDir` | `string` | `process.cwd()` | Root directory to analyze |\n| `includeDev` | `boolean` | `false` | Include dev dependencies |\n| `includePeer` | `boolean` | `false` | Include peer dependencies |\n| `maxDepth` | `number` | `10` | Maximum depth for dependency traversal |\n\n### Methods\n\n#### `build(): Promise<DependencyGraph>`\nBuild the dependency graph from package.json and source files.\n\n#### `detectCircular(): string[][]`\nDetect circular dependencies in the graph. Returns an array of cycles, where each cycle is an array of node IDs.\n\n#### `analyzeImpact(filePath): ImpactResult`\nAnalyze the impact of changing a specific file.\n\n#### `scoreHealth(): Promise<Map<string, HealthScore>>`\nScore the health of all dependencies based on npm registry data.\n\n#### `reportConsole(): string[]`\nGenerate a console report using console-grid.\n\n#### `reportHtml(outputPath?: string): Promise<string>`\nGenerate an interactive HTML report.\n\n#### `analyze(): Promise<AnalysisResult>`\nRun complete analysis (build, circular detection, health scoring).\n\n## Console Report Example\n\n```\n=== Dependency Graph Summary ===\n┌─────────────────────────┬──────────┐\n│ Metric                  │ Value    │\n├─────────────────────────┼──────────┤\n│ Total Files             │ 45       │\n│ Total Packages          │ 12       │\n│ Total Dependencies      │ 67       │\n│ Circular Dependencies   │ 2        │\n└─────────────────────────┴──────────┘\n\n=== Circular Dependencies ===\nFound 2 circular dependency cycle(s)\n┌────────┬──────────────────────────────────┐\n│ Cycle  │ Path                             │\n├────────┼──────────────────────────────────┤\n│ Cycle1 │ src/a.js → src/b.js → src/a.js   │\n│ Cycle2 │ src/x.js → src/y.js → src/x.js   │\n└────────┴──────────────────────────────────┘\n\n=== Dependency Health Scores ===\n┌─────────────────┬──────────────┬───────┬───────┐\n│ Package         │ Version      │ Grade │ Score │\n├─────────────────┼──────────────┼───────┼───────┤\n│ lodash          │ 4.17.21      │ A     │  95   │\n│ express         │ 4.18.2       │ B     │  82   │\n│ outdated-pkg    │ 1.0.0        │ F     │  45   │\n└─────────────────┴──────────────┴───────┴───────┘\n```\n\n## HTML Report Features\n\nThe HTML report includes:\n- **Summary Tab**: Overview of dependency metrics\n- **Graph Tab**: Interactive dependency graph visualization\n- **Circular Dependencies Tab**: List of all circular dependency cycles\n- **Health Scores Tab**: Detailed health scores for each dependency\n- **Impact Analysis Tab**: Interactive tool to analyze impact of file changes\n\n## Health Scoring\n\nDependency health is scored based on:\n- **Outdated versions**: Major/minor/patch updates available\n- **Maintenance**: How recently the package was updated\n- **Deprecation**: Whether the package is marked as deprecated\n- **Age**: Package maturity (new vs established packages)\n\nScores range from 0-100 with letter grades:\n- **A (90-100)**: Excellent health\n- **B (80-89)**: Good health\n- **C (70-79)**: Fair health\n- **D (60-69)**: Poor health\n- **F (0-59)**: Critical health\n\n## Impact Analysis Levels\n\n- **Low**: Changes affect few files, minimal risk\n- **Medium**: Changes affect multiple files, moderate risk\n- **High**: Changes affect many files, high risk\n- **Critical**: Changes affect large portions of codebase, very high risk\n\n## Circular Dependency Detection\n\nUses depth-first search (DFS) to detect cycles in the dependency graph. Each cycle is reported with the full path of dependencies.\n\n## License\nMIT\n","readmeFilename":"README.md"}