npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

express-route-tester

v1.0.0

Published

A CLI tool for testing Express.js routes

Downloads

13

Readme

Express Route Tester

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.

Features

  • 🔍 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

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v14 or higher)
  • npm (v6 or higher)

Installation

  1. Clone the repository:
git clone https://github.com/oliverikegah/express-route-tester.git
cd express-route-tester
  1. Install dependencies:
npm install
  1. Install the package globally (optional):
npm install -g .

Usage

Basic Usage

npx express-route-tester <path-to-your-express-app>

Example:

npx express-route-tester ./examples/app.js

Command Line Options

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

Example Output

When you run the tool, it will:

  1. Scan your Express application for routes
  2. Display all detected routes with their methods and middleware
  3. Check for route conflicts
  4. Perform dry-run testing if requested
  5. Export results if specified

Project Structure

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

Key Components

  • bin/cli.js: Main CLI interface using Commander.js
  • src/scanner.js: Core route scanning and conflict detection logic
  • src/reporter.js: Handles output formatting and display
  • src/utils.js: Utility functions for file operations
  • dryRunner.js: Implements dry-run testing functionality

Example Application

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

Contributing

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.

Development Setup

  1. Fork the repository
  2. Clone your fork:
git clone https://github.com/your-username/express-route-tester.git
  1. Install dependencies:
npm install
  1. Create a new branch for your feature:
git checkout -b feature/your-feature-name

Roadmap

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!

Author

Acknowledgments

  • Express.js team for their excellent framework
  • All contributors who help improve this tool

Support

If you encounter any issues or have questions, please:

  1. Check the Issues page
  2. Create a new issue if your problem isn't already listed
  3. Contact the author directly for urgent matters