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