@bryn-mailer/temp-eng

A simple, minimal HTML templating engine.

Usage no npm install needed!

<script type="module">
  import brynMailerTempEng from 'https://cdn.skypack.dev/@bryn-mailer/temp-eng';
</script>

README

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'
});