Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 749 Bytes

README.md

File metadata and controls

27 lines (21 loc) · 749 Bytes

Tiny Mustache

The smallest implementation of Mustache template engine.

Only 436 bytes gzipped.

Usage

mustache("Hello {{name}}!", {name: "world"})
// => Hello world!

Features

  • variables {{escaped}}, {{&unescaped}}, {{{unescaped}}}
  • sections {{#section}}
  • inverted sections {{^inverted}}
  • lambdas {{#lambda}}
  • comments {{!comment}}
  • partials {{>partial}}
  • variables dot notation {{obj.prop}}
  • tests

Not implemented

  • set delimiter {{=<% %>=}}

Browser support

This library works in every modern browser. To use it in IE you will need a polyfill for Object.assign().