lib/benchpress.js
function render(template, data, block) {
  data = Benchpress.addGlobals(data || {});

  return Promise.try(() => {
    Benchpress.cache[template] = Benchpress.cache[template] || load(template);
    return Benchpress.cache[template];
  }).then((templateFunction) => {
    if (block) {
      templateFunction = templateFunction.blocks && templateFunction.blocks[block];
    }
    if (!templateFunction) {
      return '';
    }

    return runtime(Benchpress.helpers, data, templateFunction);
  });
}
function render(template, data, block) {
  data = Benchpress.addGlobals(data || {});

  return Promise.try(() => {
    Benchpress.cache[template] = Benchpress.cache[template] || load(template);
    return Benchpress.cache[template];
  }).then((templateFunction) => {
    if (block) {
      templateFunction = templateFunction.blocks && templateFunction.blocks[block];
    }
    if (!templateFunction) {
      return '';
    }

    return runtime(Benchpress.helpers, data, templateFunction);
  });
}
function render ( template , data , block ) { data = Benchpress . addGlobals ( data || { } ) ; return Promise . try ( ( ) => { Benchpress . cache [ template ] = Benchpress . cache [ template ] || load ( template ) ; return Benchpress . cache [ template ] ; } ) . then ( ( templateFunction ) => { if ( block ) { templateFunction = templateFunction . blocks && templateFunction . blocks [ block ] ; } if ( ! templateFunction ) { return '' ; } return runtime ( Benchpress . helpers , data , templateFunction ) ; } ) ; }
Fetch and run the given template
@param {string} template - Name of template to fetch
@param {Object} data - Data with which to run the template
@param {string} [block] - Parse only this block in the template
@returns {Promise<string>} - Rendered output
Fetch and run the given template