title: Trouble with accessing express.js helpers from dust.js template
body: <p>I am playing with the node-express-boilerplate project and trying to convert it to use dust.js templates. I have dust.js render simple views with Express@3.x and dustjs-linkedin, however am stuck on converting helpers to be used inside dust.js templates.</p>
  
  <p>I redefined the code starting @ <a href="https://github.com/mape/node-express-boilerplate/blob/master/server.js:144" rel="nofollow">https://github.com/mape/node-express-boilerplate/blob/master/server.js:144</a></p>
  
  <p>to conform with the new Express@3.x version (using <a href="https://github.com/visionmedia/express/wiki/Migrating-from-2.x-to-3.x" rel="nofollow">https://github.com/visionmedia/express/wiki/Migrating-from-2.x-to-3.x</a> as a guide), as such:</p>
  
  <p>app.configure(function() {</p>
  
  <pre><code>   app.use(function(req, res, next) {
         res.locals.assetsCacheHashes = function(req, res) {
             return assetsMiddleware.cacheHashes;
         }
         res.locals.session = function(req, res) {
             return req.session;
         }
         res.locals.error = function(err, req, res, next) {
  
         // ...
  
         }
         next();
      });
  });
  </code></pre>
  
  <p>I would assume that in dust.js template, I could use {session} to test the session or {assetsCacheHashes} to test and print them out, but that does not seem to be the case.</p>
  
  <p>Any hints as to what I am doing incorrectly? Should I use dust.js helpers instead? If so, can someone suggest an example? Thanks!</p>