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.
 
Go to file
Devin W. Leaman 89819d1242
feat: added workflow_dispatch to gh action
10 months ago
.github feat: added workflow_dispatch to gh action 10 months ago
.vscode chore: updated yarn.lock and .vscode dir 1 year ago
examples feat: updated README with examples 2 years ago
src refactor: had to remove coloring as it doesnt work as expected 1 year ago
.gitignore chore: added .DS_Store to .gitignore 1 year 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 10 months ago
tsconfig.json fix: hopefully this fixes the missing type def file 1 year ago
yarn.lock chore: updated yarn.lock and .vscode dir 1 year 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.