
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
koa-router-map
Advanced tools
Koa middleware to expose routes list of a koa-router.
You can find examples of how to use this library. You can also look at the tests scenarios in the tests directory to get running examples to use.
const Koa = require('koa')
const Router = require('koa-router')
const koaRouterMap = require('koa-router-map')
const router = new Router()
router.get('Get all Examples', '/examples', async function examplesHandler(ctx) {
ctx.body = 'OK'
})
const app = new Koa()
app.use(koaRouterMap(router))
app.use(router.routes(), router.allowedMethods())
server = app.listen(3000)
Open your browser or curl : http://localhost:3000/routes/map
It should display :

Color mode in terminal only : curl http://localhost:3000/routes/map?color=true

Raw mode : GET http://localhost:3000/routes/map?raw=true

To Launch the tests :
$ npm install$ npm test$ npm run watch : It launch test when you change the code(The tests will run a koa app on port 9000 be sure that this port is available)
After running $ npm test you can access the code coverage report here : ./coverage/index.html
FAQs
Koa middleware to expose routes list of a koa-router
We found that koa-router-map demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.