View on GitHub

Ktl

Fast and simple javascript-based tempating language

Download this project as a .zip file Download this project as a tar.gz file

Koder's Template Language

What is is

Fast and simple string templating language and parser factory. KTL makes a function from your template. Simply pass a data object and get back your parsed string.

output = ktl(template)(data[,sanitizer]);

Key features

Syntax

{{ property }}

{{# array }}
  index: {{$}}, value: {{_}}
{{#}}

{{? condition }}
  it is true
{{:}}
  or is it false
{{?}}