koa-preuse

Prepending a middleware to the beginning of the middleware list for Koa application.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
koa-preuse
0.0.04 years ago4 years agoMinified + gzip package size for koa-preuse in KB

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();
} )