Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chemzqm/minstache

Mini mustache template engine
https://github.com/chemzqm/minstache

Last synced: 10 days ago
JSON representation

Mini mustache template engine

Awesome Lists containing this project

README

        

# minstache

Mini mustache template engine.

## Installation

$ component install chemzqm/minstache

## Usage

* `{name}` no convert for single brackets.
* `{{name}}` for escape attribute.
* `{{!name}}` should not escape `name`.
* `{{#admin}}admin{{/admin}}` render admin if `admin`.
* `{{^authenticated}}login{{/authenticated}}` render login if not `authenticated`.
* `{{name.frist}}` render `first` attribute of `name`.
* `{{#contacts}}

  • {{name}}
  • {{/contacts}}` render `name`s of each contacts.

    ## API

    ### minstache(string, [obj])

    Compile and render the given mustache `string` with optional context `obj`.

    ### minstache.compile(string)

    Compile the mustache `string` to a stand-alone `Function` accepting a context `obj`.

    ## License

    MIT