# koa-body-parser

> Parse request body into ctx.request.body

Latest version **1.1.2** (published 2015-05-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-body-parser
pnpm add koa-body-parser
yarn add koa-body-parser
bun add koa-body-parser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2015-05-10 |
| First published | 2013-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Thom Seddon |
| Maintainers | jongleberry, thomseddon |
| Keywords | koa |

## Links

- npm: https://www.npmjs.com/package/koa-body-parser
- Repository: https://github.com/thomseddon/koa-body-parser
- Issues: https://github.com/thomseddon/koa-body-parser/issues
- npm.io page: https://npm.io/package/koa-body-parser

## Dependencies (1)

- [co-body](https://npm.io/package/co-body.md) ^2.0.0

## Recent versions

- 1.1.2 (latest) — 2015-05-10
- 1.1.1 — 2015-01-23
- 1.1.0 — 2014-06-10
- 1.0.0 — 2014-02-11
- 0.2.1 — 2013-11-19
- 0.2.0 — 2013-11-19
- 0.1.1 — 2013-11-15
- 0.1.0 — 2013-11-15
- 0.0.1 — 2013-08-22

## README

# This project has been depreciated in favour of: https://github.com/koajs/bodyparser

---

# koa-body-parser [![Build Status](https://travis-ci.org/thomseddon/koa-body-parser.png?branch=master)](https://travis-ci.org/thomseddon/koa-body-parser)

Parse the request body in koa like ya' used to in express

## Installation

```
npm install koa-body-parser
```

## Options
 - `empty` whether to throw a 415 if the client has indicated there is a body but it cannot be parsed (default: `true`)
 - `length` length limit of the stream to pass to raw-body (default: `content-length`)
 - `limit` byte limit of the body to pass to raw-body, throws 413 if body is larger
 - `encoding` requested encoding (default: `utf8`)

## Example



```js
var bodyParser = require('koa-body-parser');
var koa = require('koa');

var app = koa();

app.use(bodyParser());

app.use(function *() {
  this.body = this.request.body; // Echo request back
  this.status = 200;
});

app.listen(3000);
```

## License

MIT

---
_Source: https://npm.io/package/koa-body-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
