Moe-js v0.3

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("", "UTF16");

// compile an async UTF16 template file
moe.compileFileSync("", {
    encoding: "UTF16",
    asyncTemplate: true

Subscribe for more like this. No spam, just fun tech stuff :)

Or, find me on Twitter: @toptensoftware.