The best mustaches were beards first.
JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 98 commits behind jxson:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
test
.gitignore
LICENSE
README.md
index.js
package.json

README.md

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 asynchronously read and render them as appropriate.

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', { foo: 'bar, layout: 'html' })
})

Options

  • directory: The directory that holds the mustache files
  • stamp: Gets added to the response header as x-beardo-stamp to aid in debugging

LICENSE (MIT)