1.0.3 • Published 5 years ago
@bryn-mailer/temp-eng v1.0.3
temp-eng
A simple, minimal HTML templating engine.
Syntax
Variable Substitution
<div>This is a variable -> {{ variable_name }}</div>
Conditionals
{ #if (variable === false) }
<div>I will be rendered if the condition evaluates to true</div>
{ #else }
<div>Otherwise I will be rendered</div>
{ #endif }
Usage
import { Template }from '@bryn-mailer/temp-eng';
const template = new Template('pathToTemplate.html');
const html = template.generateHTML({
variable: 'value'
});