npm.io
0.0.2 • Published 9 years ago

reslog

Licence
ISC
Version
0.0.2
Deps
0
Vulns
0
Weekly
0

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

Keywords