rusty react flow
A powerful command-line tool to analyze TypeScript/JavaScript modules for imports and exports.
Features
- Analyze TypeScript/JavaScript files for imports and exports
- Supports TS, TSX, JS, and JSX file extensions
- Generate detailed reports on module dependencies
- Interactive mode for selecting directories and files
- Export analysis to JSON or display in console
- Get summary statistics about most imported/exported modules
Installation
From Cargo
From NPM
Usage
Basic usage:
This will analyze the current directory and print the results to the console.
Options
USAGE:
typescript-analyzer [OPTIONS]
OPTIONS:
-p, --path <PATH> Directory path to analyze [default: .]
-i, --interactive Run in interactive mode
-o, --output <FILE> Output JSON file (default: print to stdout)
-h, --help Print help information
-V, --version Print version information
Examples
Analyze a specific directory:
Run in interactive mode:
Save analysis to a file:
Output Format
The tool generates a JSON output with the following structure:
Advanced Usage
Programmatic API
TypeScript Analyzer can also be used as a library in your Rust projects:
use ;
Development
Prerequisites
- Rust 1.56.0 or later
- Cargo
Building from Source
How It Works
TypeScript Analyzer uses swc to parse TypeScript and JavaScript files. It extracts import and export declarations from the AST and generates a comprehensive report.
The analysis process includes:
- Recursively finding all TS/JS files in the specified directory
- Parsing each file with swc
- Extracting import and export information
- Generating summary statistics
- Outputting results in JSON format
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.