Skip to content
Little Template engine of {{mustache}}
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
README.md
lt.js
package.json

README.md

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.

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

Something went wrong with that request. Please try again.