0.1.0 • Published 5 years ago

koa-profiler-middleware v0.1.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

koa-profiler-middleware

A lightweight profiling middleware for Koa. Outputs the HTTP method, endpoint requested and duration of request in ms.

Usage

import Koa from 'koa';
import profiler from 'koa-profiler-middleware';

const app = new Koa();

app.use(profiler());

// Example response:
// GET /hello 1.23ms

Parameters

OptionDefault valueDescription
logFnconsole.infoThe logging function to be called by the middleware.