0.1.3 • Published 9 years ago

ministache v0.1.3

Weekly downloads
1
License
MIT
Repository
-
Last release
9 years ago

ministache

Mustache templating with a focus on a slim size (~500 bytes gzipped). Useful for embedding into frontend libraries. ministache complies with most mustache specs with a few exceptions.

Status

API

See the mustache(5) man page for an overview of features.

var compile = require('ministache');
var template = "Greetings, {{name}}";

var tpl = compile(template);
  
tpl({ name: "John Constantine" })
=> "Greetings, John Constantine"

npm version   Available via npm install ministache

Why?

ministache is ideal for use in embedding in other redistributable frontend libraries.

  • Small: Only <1kb gzipped.
  • Standard: Compliant with almost all mustache specs (see below)

Why not?

There are some mustache features that were dropped to achieve its minimal size.

  • It's only about 40% the speed of mustache.js.
  • Does not support whitespace collapsing. Not really an issue much for HTML, anyway.
  • Does not support partials.
  • Does not support set-delimiters ({{=<% %>=}}).

Also see

  • tj/minstache (min and not mini), which isn't spec compliant and doesn't support contexts ({{#user}}{{name}}{{/}})

  • janl/mustache.js, a fast and feature-filled solution that supports partials and such

Thanks

ministache © 2015+, Rico Sta. Cruz. Released under the MIT License. Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago