Socket
Book a DemoInstallSign in
Socket

ministache

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ministache

Mustache templating with a focus on a slim size

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

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

Keywords

mustache

FAQs

Package last updated on 16 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts