lib/hbs.js
function renderTemplate(template, locals, cb) {
    var res;

    try {
      var localTemplateOptions = self.getLocalTemplateOptions(locals);
      var localsClone = _.extend({}, locals);
      self.updateLocalTemplateOptions(localsClone, undefined);
      res = template(localsClone, _.merge({}, self._options.templateOptions, localTemplateOptions));
    } catch (err) {
      if (err.message) {
        err.message = '[' + template.__filename + '] ' + err.message;
      } else if (typeof err === 'string') {
        return cb('[' + template.__filename + '] ' + err, null);
      }
      return cb(err, null);
    }
    cb(null, res);
  }
function renderTemplate(template, locals, cb) {
    var res;

    try {
      var localTemplateOptions = self.getLocalTemplateOptions(locals);
      var localsClone = _.extend({}, locals);
      self.updateLocalTemplateOptions(localsClone, undefined);
      res = template(localsClone, _.merge({}, self._options.templateOptions, localTemplateOptions));
    } catch (err) {
      if (err.message) {
        err.message = '[' + template.__filename + '] ' + err.message;
      } else if (typeof err === 'string') {
        return cb('[' + template.__filename + '] ' + err, null);
      }
      return cb(err, null);
    }
    cb(null, res);
  }
function renderTemplate ( template , locals , cb ) { var res ; try { var localTemplateOptions = self . getLocalTemplateOptions ( locals ) ; var localsClone = _ . extend ( { } , locals ) ; self . updateLocalTemplateOptions ( localsClone , undefined ) ; res = template ( localsClone , _ . merge ( { } , self . _options . templateOptions , localTemplateOptions ) ) ; } catch ( err ) { if ( err . message ) { err . message = '[' + template . __filename + '] ' + err . message ; } else if ( typeof err === 'string' ) { return cb ( '[' + template . __filename + '] ' + err , null ) ; } return cb ( err , null ) ; } cb ( null , res ) ; }
Renders `template` with given `locals` and calls `cb` with the
resulting HTML string.

@param template
@param locals
@param cb
Renders template with given locals and calls cb with the resulting HTML string .