lib/hbs.js
function getSourceTemplate(cb) {
    if (options.cache) {
      var info = self.cache[filename];
      if (info) {
        return cb(null, info.source, info.template);
      }
    }

    fs.readFile(filename, 'utf8', function(err, source) {
      if (err) return cb(err);

      var template = self.compile(source, filename);
      if (options.cache) {
        self.cache[filename] = {
          source: source,
          template: template
        };
      }
      return cb(null, source, template);
    });
  }
function getSourceTemplate(cb) {
    if (options.cache) {
      var info = self.cache[filename];
      if (info) {
        return cb(null, info.source, info.template);
      }
    }

    fs.readFile(filename, 'utf8', function(err, source) {
      if (err) return cb(err);

      var template = self.compile(source, filename);
      if (options.cache) {
        self.cache[filename] = {
          source: source,
          template: template
        };
      }
      return cb(null, source, template);
    });
  }
function getSourceTemplate ( cb ) { if ( options . cache ) { var info = self . cache [ filename ] ; if ( info ) { return cb ( null , info . source , info . template ) ; } } fs . readFile ( filename , 'utf8' , function ( err , source ) { if ( err ) return cb ( err ) ; var template = self . compile ( source , filename ) ; if ( options . cache ) { self . cache [ filename ] = { source : source , template : template } ; } return cb ( null , source , template ) ; } ) ; }
Gets the source and compiled template for filename either from the cache
or compiling it on the fly.
Gets the source and compiled template for filename either from the cache or compiling it on the fly .