# koa-router-map

> Koa middleware to expose routes list of a koa-router

Latest version **1.0.0** (published 2018-06-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-router-map
pnpm add koa-router-map
yarn add koa-router-map
bun add koa-router-map
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-06-10 |
| First published | 2018-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 49.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | SachaCR |
| Maintainers | sasquatch |
| Keywords | koa, router, map, display, middleware |

## Links

- npm: https://www.npmjs.com/package/koa-router-map
- Repository: https://github.com/SachaCR/koa-router-map
- Homepage: https://github.com/SachaCR/koa-router-map#readme
- Issues: https://github.com/SachaCR/koa-router-map/issues
- npm.io page: https://npm.io/package/koa-router-map

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [table](https://npm.io/package/table.md) ^4.0.3

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-06-10

## README

# Koa-router-map

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.

## examples :

```js
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 :

![alt text](img/table-mode.png)

## Options

- Color mode in terminal only : `curl http://localhost:3000/routes/map?color=true`
![alt text](img/color-mode.png)

- Raw mode : `GET http://localhost:3000/routes/map?raw=true`
![alt text](img/raw-mode.png)

## Tests

To Launch the tests :

- run : `$ npm install`
- run : `$ npm test`
- run : `$ 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)

## Code Coverage

After running `$ npm test` you can access the code coverage report here : `./coverage/index.html`

---
_Source: https://npm.io/package/koa-router-map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
