Nonflavored Prescription Medicine

    @donutteam/koa-error-handler

    1.0.1 • Public • Published

    Koa Error Handler

    A class for creating Koa middlewares that catch downstream errors.

    Installation

    Install the package with NPM:

    npm install @donutteam/koa-error-handler
    

    Usage

    To use this class, simply instantiate an instance and add it to your Koa stack:

    import Koa from "koa";
    
    import { ErrorHandlerMiddleware } from "@donutteam/koa-error-handler";
    
    const app = new Koa();
    
    const errorHandlerMiddleware = new ErrorHandlerMiddleware();
    
    // Be sure to add the execute function on the instance
    // and NOT the instance itself
    app.use(errorHandlerMiddleware.execute);

    License

    MIT

    Install

    npm i @donutteam/koa-error-handler

    DownloadsWeekly Downloads

    4

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    3.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • duckdotexe