koa-better-boom

1.0.1 • Public • Published

koa-better-boom


Build Status Coverage Status NPM version License Code Size

Boom response objects in Koa.js (inspired from express-boom).

Installation

# npm
$ npm install koa-better-boom
# yarn
$ yarn add koa-better-boom

Usage

This is a practical example of how to use.

const Koa = require('koa')
const koaBoom = require('koa-better-boom')
const app = new Koa()

app
  .use(koaBoom())
  .use((ctx) => {
    // ==> ctx.boom.badRequest()
    // ==> ctx.response.boom.badRequest()
    ctx.boom.badRequest()
  })

Note

For a complete list of methods, see the Boom docs.

License


MIT © Imed Jaberi

/koa-better-boom/

    Package Sidebar

    Install

    npm i koa-better-boom

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    5.71 kB

    Total Files

    5

    Last publish

    Collaborators

    • 3imed-jaberi