# simple-morgan-res-body

> simpliest and transparent way to add res-body to you morgan logger

Latest version **1.0.1** (published 2023-02-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-morgan-res-body
pnpm add simple-morgan-res-body
yarn add simple-morgan-res-body
bun add simple-morgan-res-body
```

## 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 | 2023-02-19 |
| First published | 2023-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | frani |
| Maintainers | frani |
| Keywords | morgan, response, body |

## Links

- npm: https://www.npmjs.com/package/simple-morgan-res-body
- Repository: https://github.com/frani/simple-morgan-res-body
- Homepage: https://github.com/frani/simple-morgan-res-body#readme
- Issues: https://github.com/frani/simple-morgan-res-body/issues
- npm.io page: https://npm.io/package/simple-morgan-res-body

## Recent versions

- 1.0.1 (latest) — 2023-02-19
- 1.0.0 — 2023-02-19

## README

# simple-morgan-res-body

A middleware that made simple to get your res-content-body for your morgan use

# Install

using NPM
```
npm install simple-morgan-res-body
```

or using yanr
```
yarn add simple-morgan-res-body
```

# Usage & Api

```javascript

const express = require('express')
const morgan = require('morgan')
const morgenResBody = require('simple-morgan-res-body')

const app = express()
/**
 * By default response content is set in res.contentBody
 * but you can change it with the key name that you want
*/
app.use(morgenResBody('contentBody'))

morgan.token('res-body', (req,res) => res.contentBody)

/**
 * Then setup morgan format
*/
app.use(morgan(':res-body'));
```

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