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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bhaskardey772/auto-relay

v1.0.0

Published

CLI tool to auto-discover Express.js routes and explore them in a browser — no changes needed in your app.

Readme

auto-relay

A CLI tool that auto-discovers your Express.js routes and lets you explore and test them in the browser — no changes needed in your app code.

Install the package, run two commands, done.

Current support: Node.js + Express.js


Install

npm install --save-dev @bhaskardey772/auto-relay

Usage

Step 1 — Initialize config

npx auto-relay init

This creates auto-relay.config.js in your project root:

module.exports = {
  rootDir: './',                        // directory to scan for routes
  port: 4000,                           // port for the relay explorer
  baseUrl: 'http://localhost:3000',     // your running Express app's URL
  exclude: [],
  title: 'Auto Relay',
};

Step 2 — Start your app as usual

node app.js   # or npm start, nodemon, etc.

Step 3 — Start the relay

npx auto-relay start

Open http://localhost:4000 in your browser — all your routes are there, ready to test.


What you get

  • Sidebar — all Express routes auto-detected, grouped by file or HTTP method
  • Filter & group — live-filter routes, toggle between file/method grouping
  • Request builder — path params, query params, custom headers, bearer token field, JSON body editor
  • Body pre-fillreq.body fields auto-detected from handler source code and pre-populated
  • Response viewer — syntax-highlighted JSON, raw text, response headers, status, timing, size
  • Variables{{VAR_NAME}} placeholders in any field; BASE_URL seeded automatically
  • Rescan — re-discover routes without restarting anything
  • State persistence — inputs saved per-route in localStorage

Options

// auto-relay.config.js
module.exports = {
  rootDir: './',                        // directory to scan (default: process.cwd())
  port: 4000,                           // relay server port (default: 4000)
  baseUrl: 'http://localhost:3000',     // your app's base URL
  exclude: ['tests/**', 'mocks/**'],    // extra glob patterns to skip
  title: 'Auto Relay',                  // browser tab title
};

| Option | Type | Default | Description | |-----------|------------|-------------------------|------------------------------------------------| | rootDir | string | process.cwd() | Root directory to scan for Express routes | | port | number | 4000 | Port the relay explorer runs on | | baseUrl | string | http://localhost:3000 | Base URL of your running Express app | | exclude | string[] | [] | Extra glob patterns to skip during scanning | | title | string | Auto Relay | Title shown in the browser tab and header |

CLI flags

npx auto-relay start --port=5000   # override port from CLI

How it differs from auto-detect-route

| | auto-detect-route | auto-relay | |---|---|---| | Setup | Add middleware to your Express app | Install package + run CLI | | Changes to your app | Yes — app.use('/explorer', ...) | None | | Runs | Inside your app process | Separate process, separate port | | Config | Options passed to middleware | auto-relay.config.js file |

Use auto-relay when you don't want to touch your app code at all.


How it works

auto-relay start reads your config, then:

  1. Scans your source files using AST parsing (@typescript-eslint/typescript-estree) — same engine as the auto-detect-route package.
  2. Starts a standalone Express server on the configured port.
  3. Proxies requests from the browser UI to your running app — no CORS issues.

The scan uses a 3-pass algorithm: parse all files → find entry points → DFS across require()/import chains to resolve full route paths including nested router prefixes.


Security

  • Sensitive files (.env, .key, .pem, credentials) are never read by the scanner
  • Only http: and https: protocols are allowed in the proxy
  • Response bodies are capped at 10 MB
  • Keep the relay server on localhost — do not expose it publicly

License

MIT