rusty-react-flow
v0.1.2
Published
Parsing and analyzing React Components Flow code
Downloads
15
Maintainers
Readme
🚀 rusty-react-flow
A powerful command-line tool to analyze TypeScript/JavaScript modules for imports and exports.
✨ Features
- 🔍 Analyze
.ts,.tsx,.js, and.jsxfiles for imports and exports - 📊 Generate detailed reports on module dependencies
- 🎛 Interactive mode for selecting directories and files
- 📁 Export analysis to JSON or display in console
- 📈 Summary statistics for most imported/exported modules
📦 Installation
As a library dependency
cargo add rusty-react-flowGlobal CLI (Cargo)
cargo install rusty-react-flowNode.js projects (NPM)
npm install -D rusty-react-flowInvoke via npx:
npx rusty-react-flow [OPTIONS]⚙️ Usage
Run without arguments to analyze the current directory:
rusty-react-flow
# or via npm:
# npx rusty-react-flow❯ CLI Options
| Option | Description | Default |
| ----------------------- | ------------------------- | ------- |
| -p, --path <PATH> | Directory path to analyze | . |
| -i, --interactive | Run in interactive mode | — |
| -o, --output <FILE> | Write output JSON to file | stdout |
| --help | Print help information | — |
| --version | Print version information | — |
❯ Examples
Analyze
srcfolder:rusty-react-flow --path ./srcInteractive mode:
rusty-react-flow --interactiveSave JSON output:
rusty-react-flow --output report.jsonAll combined (with npx):
npx rusty-react-flow --path ./lib --interactive --output deps.json
📄 Output Format
The JSON output has this structure:
{
"files": [
{
"filePath": "src/App.tsx",
"imports": [{ "name": "React", "source": "react", "kind": "default" }],
"exports": [{ "name": "App", "kind": "default-function" }]
}
],
"summary": {
"totalFiles": 1,
"totalImports": 1,
"totalExports": 1,
"mostImported": ["react"],
"mostExported": ["App"]
}
}🛠️ Development
Prerequisites
- Rust 1.85.1 or later
- Cargo
Build from source
git clone https://github.com/cargo-fob/rusty-react-flow.git
cd rusty-react-flow
cargo build --release