You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use this module for simple build-time or utility rendering when you want interpolation, small helper blocks, and nested-object lookup without bringing in a larger template engine.
API
Constructor
constengine=newTemplateEngine();
TemplateOptions supports:
container
delimiters
helpers
resolve
TemplateEngine Properties
Name
Notes
block
Compiled block-helper regexp.
container
Wrapper used when resolving values, default %s.
delimiters
Default ['{{', '}}'].
helpers
Helper registry.
method
Compiled method-helper regexp.
resolve
Value resolver.
variable
Compiled variable regexp.
TemplateEngine Methods
Method
Returns
render(template, props = {})
string
Module Exports
Export
Notes
escapeRegex(str)
Escapes text for RegExp construction.
render(template, props = {}, options = {})
One-shot helper that creates a TemplateEngine and renders.