lib/express.js
function __express(filepath, data, next) {
  data = Benchpress.addGlobals(data);
  data._locals = null;

  if (Benchpress.cache[filepath]) {
    render(filepath, data, Benchpress.cache[filepath], next);
    return;
  }

  fs.readFile(filepath, 'utf-8', (err, code) => {
    if (err) {
      next(err);
      return;
    }

    let template;
    try {
      template = Benchpress.cache[filepath] = evaluate(code);
    } catch (e) {
      e.message = `Evaluate failed for template ${filepath}:\n ${e.message}`;
      e.stack = `Evaluate failed for template ${filepath}:\n ${e.stack}`;

      process.nextTick(next, e);
      return;
    }

    render(filepath, data, template, next);
  });
}
function __express(filepath, data, next) {
  data = Benchpress.addGlobals(data);
  data._locals = null;

  if (Benchpress.cache[filepath]) {
    render(filepath, data, Benchpress.cache[filepath], next);
    return;
  }

  fs.readFile(filepath, 'utf-8', (err, code) => {
    if (err) {
      next(err);
      return;
    }

    let template;
    try {
      template = Benchpress.cache[filepath] = evaluate(code);
    } catch (e) {
      e.message = `Evaluate failed for template ${filepath}:\n ${e.message}`;
      e.stack = `Evaluate failed for template ${filepath}:\n ${e.stack}`;

      process.nextTick(next, e);
      return;
    }

    render(filepath, data, template, next);
  });
}
function __express ( filepath , data , next ) { data = Benchpress . addGlobals ( data ) ; data . _locals = null ; if ( Benchpress . cache [ filepath ] ) { render ( filepath , data , Benchpress . cache [ filepath ] , next ) ; return ; } fs . readFile ( filepath , 'utf-8' , ( err , code ) => { if ( err ) { next ( err ) ; return ; } let template ; try { template = Benchpress . cache [ filepath ] = evaluate ( code ) ; } catch ( e ) { e . message = ` ${ filepath } \n ${ e . message } ` ; e . stack = ` ${ filepath } \n ${ e . stack } ` ; process . nextTick ( next , e ) ; return ; } render ( filepath , data , template , next ) ; } ) ; }
Provide functionality to act as an express engine
@param {string} filepath - Compiled template file path
@param {Object} data - Data with which to parse the template
@param {function} next - (err, output)
Provide functionality to act as an express engine