A Koa middleware that outputs the routes registered to the application.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Go to file
Devin W. Leaman 89819d1242 feat: added workflow_dispatch to gh action 1 year ago
.github feat: added workflow_dispatch to gh action 1 year ago
.vscode chore: updated yarn.lock and .vscode dir 2 years ago
examples feat: updated README with examples 2 years ago
src refactor: had to remove coloring as it doesnt work as expected 2 years ago
.gitignore chore: added .DS_Store to .gitignore 2 years ago
.prettierignore feat: added initial files 2 years ago
.prettierrc feat: added initial files 2 years ago
LICENSE Initial commit 2 years ago
README.md feat: updated README with examples 2 years ago
package.json 1.4.3 1 year ago
tsconfig.json fix: hopefully this fixes the missing type def file 2 years ago
yarn.lock chore: updated yarn.lock and .vscode dir 2 years ago

README.md

@4lch4/koa-router-printer

This repo is a lightweight utility for Koa.js applications that utilize @koa/router. It outputs a two-column table containing the registered path(s) and method(s).

Examples

NOTE: These examples are also available in the examples directory.

Example 0

Printer(app, {
  displayHead: false,
  displayPrefix: true
})

Example-Screenshot

Example 1

Printer(app, {
  displayHead: true,
  displayPrefix: false
})

Example-Screenshot

Options

The module accepts two options along with the app parameter:

  • displayHead
    • Whether or not to display the HEAD method with a path.
  • displayPrefix
    • Whether or not to display the prefix ahead of each Route path.