Moe-js v0.3

moe.compileFile

The compileFile function loads a template from text file, compiles it using the moe.compile function and stores the result in an internal cache.

compileFile first tries to load from a file exactly as specified by filename. If the file doesn't exist and the filename doesn't end with ".moe" then ".moe" is appended to the filename and tried again.

function moe.compileFile(filename, options, callback)
  • filename - the file to compile
  • options - compile options (see below)
  • callback - function that will be called when the template has been compiled

The callback function is a typical Node style callback:

function callback(err, template)