# reslog

> Attach a log array to express response object then optionally pass into a view

Latest version **0.0.2** (published 2017-09-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install reslog
pnpm add reslog
yarn add reslog
bun add reslog
```

## 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.0.2 |
| Published | 2017-09-17 |
| First published | 2017-09-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | drew |
| Maintainers | drwndrsn |
| Keywords | express, log |

## Links

- npm: https://www.npmjs.com/package/reslog
- Repository: https://github.com/drwndrsn/reslog
- Homepage: https://github.com/drwndrsn/reslog#readme
- Issues: https://github.com/drwndrsn/reslog/issues
- npm.io page: https://npm.io/package/reslog

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2017-09-17
- 0.0.1 — 2017-09-10

## README

# reslog

Adds a function and an array to the express response object: log() and _log.

Build up the _log array by calling res.log() with a description and whatever objects to log, Ex:

```javascript
res.log('User object', res.locals.session.user)
res.log('Session expires', res.locals.session.expires)
```

then call 

```javascript
res.log() 
```

with no arguments to return an object { 'reslog' : (_log array as a formatted JSON string) } which can then be passed into a view

```javascript
res.render('view', res.log())
```

Put {{ reslog }} in the view, like below the footer

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