# @byu-oit/express-profiler-middleware

> An express middleware function for profiling client requests

Latest version **0.1.1** (published 2020-10-30) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @byu-oit/express-profiler-middleware
pnpm add @byu-oit/express-profiler-middleware
yarn add @byu-oit/express-profiler-middleware
bun add @byu-oit/express-profiler-middleware
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-10-30 |
| First published | 2020-10-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Brigham Young University |
| Maintainers | mzroth, jonnytullis, snelg, martingarn, blakemorgan, byujol, yoshutch, lehinpm, oscea, stuft2, pauldeden, mhailstone, gi60s, arasmus8, garygsc |
| Keywords | express, middleware, profiler, v8-profiler |

## Links

- npm: https://www.npmjs.com/package/@byu-oit/express-profiler-middleware
- Repository: https://github.com/byu-oit/express-profiler-middleware
- Homepage: https://github.com/byu-oit/express-profiler-middleware#readme
- Issues: https://github.com/byu-oit/express-profiler-middleware/issues
- npm.io page: https://npm.io/package/@byu-oit/express-profiler-middleware

## Dependencies (1)

- [v8-profiler-next](https://npm.io/package/v8-profiler-next.md) ^1.3.0

## 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

- 0.1.1 (latest) — 2020-10-30
- 0.0.2 — 2020-10-29
- 0.0.1 — 2020-10-29
- 0.0.0 — 2020-10-29

## README

# Express Profiler Middleware
An Express middleware function for profiling client requests using the v8 profiler 
(See [v8-profiler-next](https://github.com/hyj1991/v8-profiler-next#v8-profiler-next)).

### Usage Example

```js
const express = require('express')
const profiler = require('@byu-oit/express-profiler-middleware')

const app = express()

app.use(profiler.middleware((req, profile) => {
  const fileName = `${Date.now().toString()}-${req.method}${req.path.split('/').join('-')}.cpuprofile`
  profile.export((error, result) => fs.writeFileSync(fileName, result))
}))

app.get('/xhealth', (req, res) => {
  setTimeout(() => res.sendStatus(200), 250)
})

let port = process.env.PORT || 8080
app.listen(port, () => console.log(`Server listening on port ${port}`))
```

---
_Source: https://npm.io/package/@byu-oit/express-profiler-middleware · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
