handlebars-async

Make Handlebars async

npm install handlebars-async
3 downloads in the last week
16 downloads in the last month

Handlebars-Async

Make Handlebars async!

Install

npm install handlebars-async

Usage

var Handlebars = require('handlebars');
var handlebarsAsync = require('handlebars-async');

handlebarsAsync(Handlebars);

Handlebars.registerHelper('async', function(arg1) {
  var done = this.async();

  setTimeout(function() {
    done(null, arg1.toUpperCase())
    done();
  }, 1000);
});

var tpl = Handlebars.compile('{{asyncHelper "value"}}');

tpl(function (err, result) {
  // result == "VALUE"
});

Copyright (c) 2010 Loïc Mahieu.

npm loves you