3

I would like to be able to display all available variables that the currently loaded jade file has access to.

I realise this is a little odd, but there you go :)

I am not really bothered if its in the console or outputting to the page.

console.info(res.locals) //this gives back way more than jade has access to.
Jamie Hutber
  • 26,790
  • 46
  • 179
  • 291

1 Answers1

4

Assign that locals onto a property of itself

app.use(function locals(req, res, next) {
    res.locals.locals = res.locals;    
    next();
});

Then simply access locals in your Jade template.

laggingreflex
  • 32,948
  • 35
  • 141
  • 196