task-registry-template-engine-lodash
The lodash template engine.
Usage
var TemplateEngine = //register the lodash template engine var result = templateEngine // the result is 'hello Mikey!' var lodashEngine = TemplateEngine 'Lodash'result = lodashEngine // the result is 'hello Mikey!' result = lodashEngine
API
templateEngine.executeSync(aOptions)/templateEngine.execute(aOptions, done)
- arguments
aOptions
(Object):template
(String): the template stringwrite
(Boolean): write the template function(compiled from the template string) to the template engine. default to false.data
(Object): the data properties to replace.escape
(RegExp): # The HTML "escape" delimiter.evaluate
(RegExp): # The "evaluate" delimiter.imports
(Object): # An object to import into the template as free variables.interpolate
(RegExp): # The "interpolate" delimiter.sourceURL
(String): # The sourceURL of the template’s compiled source.variable
(String): # The data object variable name.
done
Function(error, result): the result callback function for async execute.
- returns (String): the rendered result string.
TODO
License
MIT