koa-body

koa middleware that parses request body

npm install koa-body
2 downloads in the last day
49 downloads in the last week
319 downloads in the last month

koa-body

koa middleware for parsing a request body. This is a simple wrapper around co-body. Provides similar functionality to the express's request body parser

Doesn't support multipart

Installation

$ npm install koa-body

Options

  • patchNode Set the body parameter in the node request object this.req.body defauls to false
  • patchKoa Set the body parameter in the koa request object this.request.body defaults to true

Example

var koa = require('koa');
var koa_body = require('koa-body');
var app = koa();

app.use(koa_body());

app.use(function *(){
  console.log(this.request.body);
});

License

MIT

npm loves you