2 releases
Uses new Rust 2024
new 0.1.1 | Apr 19, 2025 |
---|---|
0.1.0 | Apr 19, 2025 |
#2316 in Command line utilities
37 downloads per month
1MB
412 lines
Contains (Mach-o exe, 2MB) bin/rusty-react-flow
🚀 rusty-react-flow
A powerful command-line tool to analyze TypeScript/JavaScript modules for imports and exports.
✨ Features
- 🔍 Analyze
.ts
,.tsx
,.js
, and.jsx
files 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-flow
Global CLI (Cargo)
cargo install rusty-react-flow
Node.js projects (NPM)
npm install -D rusty-react-flow
Invoke 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
src
folder:rusty-react-flow --path ./src
-
Interactive mode:
rusty-react-flow --interactive
-
Save JSON output:
rusty-react-flow --output report.json
-
All 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
🤝 Contributing
Contributions are welcome:
- Fork the repo
- Create a branch (
git checkout -b feature/X
) - Commit your changes (
git commit -m "Add feature X"
) - Push (
git push origin feature/X
) - Open a Pull Request
📝 License
MIT © Jaeha Lee
Dependencies
~12–21MB
~284K SLoC