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

Package detail

koa-better-error-handler-wrapper

3imed-jaberi20MIT1.1.0

A wrapper function provide a fast way to start with koa better error handler.

koa, error-handler, wrapper, koa-better-error-handler-wrapper, koa-better-error-handler, koa-404-handler, middleware

readme

koa-better-error-handler-wrapper

NPM version License Code Size

A wrapper function provide a fast way to start with koa better error handler.

Installation

# npm ..
$ npm install koa-better-error-handler-wrapper koa-better-error-handler koa-404-handler
# yarn ..
$ yarn add koa-better-error-handler-wrapper koa-better-error-handler koa-404-handler

Usage

This is a practical example of how to use.

const Koa = require("koa");
const koaBetterErrorHandlerWrapper = require("koa-better-error-handler-wrapper");

const app = koaBetterErrorHandlerWrapper(new Koa());

Arguments

You can pass some arguments to the wrapper function;

  • app — koa application instance.
  • isApi — (Boolean) tell the error handler that it's dealing with an API (default to true).
  • ...koaBetterErrorHandlerArgs — all the rest arguments are passed directly to koa-better-error-handler. for more details see the original reference here.

License

MIT © Imed Jaberi

changelog

CHANGE LOG

v1.1.0 (13 Apr 2021)

  • fix the linter bug.

v1.0.0 (13 Apr 2021)