Compile Options
Each of the compile methods has an options
parameter which accepts an object with the following
members:
{
encoding: "UTF8", // File encoding for compileFile* functions
asyncTemplate: false, // Whether to compile a sync or async template function
}
The values shown above are the default values used if not explicitly specified.
You can also pass a boolean value which will set the asyncTemplate
option, or a string which
will set the encoding
option. eg:
// compile an async template
moe.compile('...', true);
// compile a UTF16 template file
moe.compileFileSync("template.moe", "UTF16");
// compile an async UTF16 template file
moe.compileFileSync("template.moe", {
encoding: "UTF16",
asyncTemplate: true
});