Kind: global class
Represents a Templates
Param | Type | Description |
---|---|---|
config | object |
The configuration object (optional) |
Sets the default options passed to the compile function of each template engine.
Kind: instance method of Templates
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
defaultOptions | object |
The default options |
Registers a single library containing its own template engine directories, template engines, and template directories.
Kind: instance method of Templates
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
library | object |
The library object |
Registers an engine directory.
Kind: instance method of Templates
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
path | Array.<string> |
The engine directory path |
Registers a single engine.
Kind: instance method of Templates
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
path | Array.<string> | object |
The engine path or object |
Registers a template directory.
Kind: instance method of Templates
Returns: same instance to allow chaining
Param | Type | Description |
---|---|---|
path | Array.<string> |
The template directory path |
Compiles a template from source
Kind: instance method of Templates
Returns: the compile template function
Param | Type | Description |
---|---|---|
engineName | string |
The engine name to lookup |
source | string |
The template source |
options | object |
(Optional) The template options |
Compiles a template from a file
Kind: instance method of Templates
Returns: the compile template function
Param | Type | Description |
---|---|---|
templateFile | string |
The template file to compile |
options | object |
(Optional) The template options |