Skip to content

PeterHancock/async-mustache.js

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published