# koa-response-time

> X-Repsonse-Time middleware for koa

Latest version **2.1.0** (published 2018-11-27) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2018-11-27 |
| First published | 2013-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/koa-response-time) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 127 |
| Maintainers | aheckmann, coderhaoxin, dead_horse, eivifj, fengmk2, jongleberry, juliangruber, tjholowaychuk |
| Keywords | koa, middleware, response, duration |

## Links

- npm: https://www.npmjs.com/package/koa-response-time
- Repository: https://github.com/koajs/response-time
- Homepage: https://github.com/koajs/response-time#readme
- Issues: https://github.com/koajs/response-time/issues
- npm.io page: https://npm.io/package/koa-response-time

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2018-11-27
- 2.0.0 (next) — 2016-03-24
- 1.0.2 — 2014-03-23
- 1.0.1 — 2013-12-22
- 1.0.0 — 2013-08-17

## README

# koa-response-time

[![Greenkeeper badge](https://badges.greenkeeper.io/koajs/response-time.svg)](https://greenkeeper.io/)

 X-Response-Time middleware for [koa](https://github.com/koajs/koa).  Compatible with [request-received](https://github.com/cabinjs/request-received).

## Installation

```js
$ npm install koa-response-time
```

## Usage

  Basic usage:

```js
const Koa = require('koa');
const responseTime = require('koa-response-time');
const app = new Koa();

app.use(responseTime());
```

  If you need response high resolution in nano time, set `hrtime` option to `true`:

```js
app.use(responseTime({ hrtime: true }));
```


  Sample response header with `hrtime = false` (default):

```
X-Response-Time: 153ms
```

  Sample response header with `hrtime = true`:

```
X-Response-Time: 153.123581ms
```

## Note

  Best to `.use()` at the _top_ before any other middleware,
  to wrap all subsequent middleware.

## License

  MIT

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