# koa-response-length

> Calculate the length of a response

Latest version **1.2.0** (published 2014-01-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-response-length
pnpm add koa-response-length
yarn add koa-response-length
bun add koa-response-length
```

## 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.2.0 |
| Published | 2014-01-29 |
| First published | 2014-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | segment |

## Links

- npm: https://www.npmjs.com/package/koa-response-length
- Repository: https://github.com/segmentio/koa-response-length
- Issues: https://github.com/segmentio/koa-response-length/issues
- npm.io page: https://npm.io/package/koa-response-length

## Dependencies (1)

- [passthrough-counter](https://npm.io/package/passthrough-counter.md) 0.0.1

## Recent versions

- 1.2.0 (latest) — 2014-01-29
- 1.1.0 — 2014-01-29

## README

# koa-response-length

  Emit events about response lenghts.

## Example

```js
var responseLength = require('koa-response-length');

app.use(responseLength());

app.use(function*(){
  this.body = someStream();
  // also works with strings, buffers, json etc
});

app.on('response', function(len, ctx){
  console.log('url: %s length: %s', ctx.url, len);
});
```

## Installation

```bash
$ npm install koa-response-length
```

## API

### responseLength()

  Create a middleware that makes the koa app emit `response` events whenever a
  response is done, passing both the total response length and it's koa context.

## License

  MIT

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