High performance logic less template engine, supports full mustache spec


Logic-less template engine

Compiles mushtache templates to AST which are then rendered using a super slim runtime engine. Please check the benchmarks to see the performance for yourself, even beats dust.js by 10-20%. Still an alpha product, use it to toy around.

Full support for mustache templates. Please refer to examples directory for samples from mustache man pages.

  • Features
    • Variables - presence, absence (empty string), html escaping
    • Comments
  • Set delimiter - not yet supported (only default delimiters supported)

To compile templates

var bigote=require('bigote');
// load the templates
var compiledTemplate = bigote.load(templateString);

To render compiled template

// set the data in context and call
var result=bigote.render(compiledTemplate, context);

To use it on the browser side, include the script from dist directory

<script src="bigote-full-0.3.0.js"></script>

To compile template

// load the template and partials (optional)
// templateString="...{{abc}}......";
// partials={partialName:" partial string {{xyz}} ...", ...}
var tmpl = bigote.load(templateString, partials);

To render template

// tmpl is from previous load statement
// ctx is the object that carries data
bigote.render(tmpl, ctx);

Please refer to benchmark directory (this directory have the benchmark files from dust.js updated with bigote for comparison). For those who want to see a screen shot.

To run all the unit tests

// runs all the mocha tests, just issue
  • Inspired by mushtache, dust.js
  • PEG.js -
  • Hogan -
  • Dust -
  • Mu2 -