koa-preuse
v0.0.0
Published
Prepending a middleware to the beginning of the middleware list for Koa application.
Downloads
805
Maintainers
Readme
koa-preuse
Prepending a middleware to the beginning of the middleware list for Koa application.
Installation
$ npm i koa-preuse --save
Usage
const Koa = require( 'koa' );
const preuse = require( 'koa-preuse' );
const app = new Koa();
app.use( () => {} ); // Middleware One
preuse( app, ( ctx, next ) => {
// this middleware will be executed before the "Middleware One"
next();
} )