Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    handlebars-asyncpublic

    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

    Copyright (c) 2010 Loïc Mahieu.

    install

    npm i handlebars-async

    Downloadsweekly downloads

    10

    version

    1.0.0

    license

    BSD

    repository

    githubgithub

    last publish

    collaborators

    • avatar