bigote

0.3.11 • Public • Published

Build Status

bigote

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.

Features

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

Todo

  • Set delimiter - not yet supported (only default delimiters supported)

Load

To compile templates

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

Render

To render compiled template

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

Browser

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:"...my 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);

Performance

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.

Template engine

Tests

To run all the unit tests

// runs all the mocha tests, just issue
make

Notes

Useful Links

Readme

Keywords

none

Package Sidebar

Install

npm i bigote

Weekly Downloads

9

Version

0.3.11

License

none

Last publish

Collaborators

  • openmason