koa-error-lite
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

koa-error-lite

A minimal error-handler middleware for Koa apps

Build Status

This is the recommended Koa error handler published as an npm package. I always use this middleware in my Koa apps, so it made sense to make it reusable.

TypeScript declarations are included in the package.

Requirements

This middleware is designed specifically for Koa v2, and so it requires Node v7.4+ (due to the usage of async functions).

Installation

$ npm install koa-error-lite

Usage

const Koa = require('koa')
const errorHandler = require('koa-error-lite')

const app = new Koa()

// This middleware should be above any other middleware that you want to catch errors for.
app.use(errorHandler())

// Other middleware...

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i koa-error-lite

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

2.93 kB

Total Files

5

Last publish

Collaborators

  • saadq