In our previous posts, you see how you can create templates and load them asynchronously using Knockout. But not everyone needs Knockout’s functionality. Maybe you just want to get some data and display it using a template.
Mustache is a library that allows you to read in JSON formatted data and display it using templates you design.
Mustache can be used for HTML, config files, source code – anything. It works by expanding tags in a template using values provided in a hash or object.
Mustache is logic-less because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values.
Mustache provides the same functionality to libraries like underscore.js, handlebars.js, and dust.js.