reslog

0.0.2 • Public • Published

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:

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

then call

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

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

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

Readme

Keywords

Package Sidebar

Install

npm i reslog

Weekly Downloads

0

Version

0.0.2

License

ISC

Last publish

Collaborators

  • drwndrsn