koa2-timer

1.0.0 • Public • Published

koa2-timer

time your koa2 middleware

img

Install

npm install koa2-timer

Example

See the example.

API

timer = Timer(options)

Initialize a timer with the following options:

  • slow (default 75): set what "slow" middleware means to your app
  • debug (default "koa:timer"): the debug namespace you want to use
  • threshold (default: false): only display middleware that's slower than the threshold
  • verbose (default: false): setting to true will show the timing before and after await next()

Then to instrument the middleware, you do the following:

app.use(timer(middleware()))

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i koa2-timer

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.9 kB

Total Files

6

Last publish

Collaborators

  • fineen