# fh-request-timer

> Express middleware to add a timer to all requests, sending the result to RHMAP stats and optionally adding the time taken as a response header

Latest version **1.0.1** (published 2016-03-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install fh-request-timer
pnpm add fh-request-timer
yarn add fh-request-timer
bun add fh-request-timer
```

## 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.0.1 |
| Published | 2016-03-16 |
| First published | 2016-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Al Graham |
| Maintainers | tinyexplosions |
| Keywords | express, RHMAP, request, timer |

## Links

- npm: https://www.npmjs.com/package/fh-request-timer
- Repository: https://github.com/TinyExplosions/fh-request-timer
- Homepage: https://github.com/TinyExplosions/fh-request-timer#readme
- Issues: https://github.com/TinyExplosions/fh-request-timer/issues
- npm.io page: https://npm.io/package/fh-request-timer

## Dependencies (2)

- [on-headers](https://npm.io/package/on-headers.md) ~1.0.1
- [fh-mbaas-api](https://npm.io/package/fh-mbaas-api.md) ~5.5.6

## Recent versions

- 1.0.1 (latest) — 2016-03-16
- 1.0.0 — 2016-03-16

## README

fh-request-timer
========================

A simple request timer middleware for express apps that logs request time to the
Red Hat Mobile Application Platform, as well as adding an optional `x-fh-timer` header to
each response.

Implementation
--------------

``` javascript
// require module
var reqTimer = require('fh-request-timer');

// include timer middleware
app.use(reqTimer());
```

Configuration
--------------

To remove the `x-fh-timer` from the response, pass the option `{addHeader:false}`
when calling the middleware:

```
// include timer middleware
app.use(reqTimer({addHeader: false}));
```


Run Unit Tests
--------------

``` shell
npm install
npm test
```

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