A powerful CLI tool for testing and analyzing Express.js routes in your Node.js applications. This tool helps developers inspect, test, and validate their Express.js route configurations with ease.
- 🔍 Route Analysis: Automatically detects and lists all Express.js routes in your application
⚠️ Conflict Detection: Identifies route conflicts (same path and method combinations)- 🧪 Dry Run Testing: Test routes without actually running the server
- 📊 Export Capabilities: Export results to JSON or Markdown format
- 🔄 Middleware Analysis: Shows middleware attached to each route
- 📝 Detailed Reporting: Comprehensive information about routes, methods, and middleware
Before you begin, ensure you have the following installed:
- Node.js (v14 or higher)
- npm (v6 or higher)
- Clone the repository:
git clone https://github.com/oliverikegah/express-route-tester.git
cd express-route-tester
- Install dependencies:
npm install
- Install the package globally (optional):
npm install -g .
npx express-route-tester <path-to-your-express-app>
Example:
npx express-route-tester ./examples/app.js
The tool supports the following command-line options:
-o, --output <file>
: Export results to a file (supports .json or .md format)--dry-run
: Perform a dry-run test on all routes-h, --help
: Display help information-v, --version
: Display version information
When you run the tool, it will:
- Scan your Express application for routes
- Display all detected routes with their methods and middleware
- Check for route conflicts
- Perform dry-run testing if requested
- Export results if specified
express-route-tester/
├── bin/
│ └── cli.js # CLI entry point and command handling
├── src/
│ ├── scanner.js # Route scanning and conflict detection
│ ├── reporter.js # Output formatting and display
│ └── utils.js # Utility functions and file operations
├── examples/
│ └── app.js # Example Express application
├── dryRunner.js # Route testing utilities
└── package.json # Project dependencies and scripts
bin/cli.js
: Main CLI interface using Commander.jssrc/scanner.js
: Core route scanning and conflict detection logicsrc/reporter.js
: Handles output formatting and displaysrc/utils.js
: Utility functions for file operationsdryRunner.js
: Implements dry-run testing functionality
The project includes an example Express application (examples/app.js
) that demonstrates:
- Basic route definitions
- Middleware usage
- Route conflicts (for testing conflict detection)
- Request body validation
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/express-route-tester.git
- Install dependencies:
npm install
- Create a new branch for your feature:
git checkout -b feature/your-feature-name
Check out our todo.md file for planned features and enhancements, including:
- Security/auth checks
- CI/CD mode
- Tag-based filtering
- Interactive CLI
- Route coverage detection
- OpenAPI export
- And more!
- Oliver Ikegah - oliverikegah@gmail.com
- Express.js team for their excellent framework
- All contributors who help improve this tool
If you encounter any issues or have questions, please:
- Check the Issues page
- Create a new issue if your problem isn't already listed
- Contact the author directly for urgent matters