ministache
Mustache templating with a focus on a slim size
Last updated 6 years ago by rstacruz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ministache 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.3                                ...           latest (6 years ago)

4 Versions

  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |