Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

koa-preuse

LvChengbin3.7kMIT0.0.0

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

prepend, use, koa, preuse, middleware, unshift

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