1.1.1 • Published 12 years ago
beardo v1.1.1
beardo
Provides an easy way to use layout aware mustache templates in your node.js projects. Add mustache files to a templates directory and use beardo's methods to simply asynchronously read and render them as appropriate for your setup.
If you are using one of the http handlers (beardo.middleware, beardo.handler) ETags get automatically added and 304 responses occur based on the if-none-match request header.
beardo.handler(res, req, options)
Adds a Templar style response handler.
var beardo = require('beardo')
, beardopts = { directory: path.join(__dirname, './templates')
, stamp: 'stamp-' + process.pid
}
http.createServer(function(req, res) {
res.template = beardo.handler(req, res, beardopts)
// Meanwhile
res.template('heyo', { headers: headers, layout: 'html' })
})Options
directory: The directory that holds the mustache filesstamp: Gets added to the response header asx-beardo-stampto aid in debugging