New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

components-dependency-graph

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

components-dependency-graph

A script for creating a graph of relationships between components in React.js / React Native applications.

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Components Dependency Graph

A script for creating a graph of relationships between components in React.js / React Native applications.

Usage

File mode

npx components-dependency-graph -f /path/to/component.tsx

Directory mode

npx components-dependency-graph -d /path/to/directory

Options

--config <path> – Allow to use config in different location (details about config below).

--generate_diagram <path> – Generates diagram in SVG format based on GraphViz.

Configuration

Just create in base location file called cdg.config.json:

{
  "excludeDirectoriesWithNameContains": [
    // ...
  ],
  "excludeFilesContains": [
    /// ...
  ],
  "rootPath": "",
  "generateGraphWithFilesPaths": true,
  "pathAliases": {
    "@assets": "./src/assets/"
  }
}

Available parameters

PropertyTypeDescription
excludeDirectoriesWithNameContainsArrayIf catalog path contains one of string from this list will be ignored.
excludeFilesContainsArrayIf filename contains one of string from this list will be ignored.
rootPathstringSpecify the path of the main project root.
generateGraphWithFilesPathsbooleanSpecify if graph nodes should have path added to name.
pathAliasesRecord<string, string>Dictionary to replaces paths based on Babel configuration

VSCode Extension

components-dependency-graph-vscode

License

MIT

FAQs

Package last updated on 22 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts