lt

0.3.3 • Public • Published

LT

Build Status

Little Template engine with {{Mustache}} specification implemented in javascript.

Installation

$ npm install lt

or download

Syntax

Detail see here

Variables

this is {{name}}
 
self print {{.}}

Unescape HTML tags

print some html {{&content}}

Sections

Use Non-False values or iterate Non-Empty lists.

{{#items}}
    {{name}}
{{/items}}

Inverted Sections

{{^money}}
    show me the money
{{/money}}

Comments

{{! here is comments }}

Partials

TODO

Lambdas

TODO

Extra Features

Nested path

LT supports nested path like javascript. Note that you cannot read property of null or undefined value.

this is {{path.to.value}}

Parent path

../ references that use variable of parent context.

{{#child}}
    {{../name}}
{{/child}}

Extremely fast

Morden Mustache-style template engine Benchmark Benchmark

API

lt(source), lt.compile(source)

Compile source(String) to template(Function)

template(data), template.render(data)

Render data(Object/JSON), return String

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i lt

Weekly Downloads

150

Version

0.3.3

License

none

Last publish

Collaborators

  • rhyzx