Skip to content
No description or website provided.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
js
test
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
async-mustache.js
bower.json
karma.conf.js
package.json

README.md

async-mustache.js Build Status

Asyncronous view functions

NPM

A wrapper around https://github.com/janl/mustache.js/ providing asyncronous view functions

Usage

Node:

var Mustache = require('mustache');
var AsyncMustache = require('async-mustache')({mustache: Mustache});

var view = {
    async: AsyncMustache.async(function (text, render, callback) {
        setTimeout(function () {
            callback(null, render(text));
        }, 0);
    }))
};

AsyncMustache.render('{{#async}}async-{{/async}}mustache.js', view).then(function (output) {
    console.log(output); // async-mustache.js
});

Browser:

<script src="mustache.js"></script>
<script src="async-mustache.js"></script>
<script>
var asyncMustache = require('async-mustache')({mustache: Mustache});
//Use it
</script>

LICENSE

MIT

Something went wrong with that request. Please try again.