react-component-graph v1.0.1
React Component Graph
A tool to generate a component interaction graph for React codebases.
Installation
To install the package globally using npm, run:
npm install -g react-component-graphUsage
To generate a component interaction graph, run the following command:
react-component-graph --src /path/to/react/projectOptions
-s, --src <directory>: Source directory of the React project.
Example
react-component-graph --src ./srcThis command will generate a components.png file in the current directory, containing the component interaction graph.
Configuration
You can customize the behavior of the tool using the following options:
--output <file>: Specify the output file for the graph. Default iscomponents.png.--format <format>: Specify the output format for the graph (e.g.,png,svg). Default ispng.--extensions <ext>: Specify the file extensions to scan (e.g.,jsx, tsx). Default isjsx, tsx.
Example with Configuration Options
react-component-graph --src ./src --output graph.svg --format svg --extensions jsx,tsxPerformance
For large codebases, the tool is optimized to use asynchronous file operations and caching mechanisms to improve performance. Ensure your project structure is well-organized to benefit from these optimizations.
Contributing
Contributions are welcome! Please open issues and submit pull requests for any improvements or new features.
License
This project is licensed under the MIT License.
Author:
BR0K3Nreality Follow me on Github: https://github.com/BR0K3Nreality