Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eugenioclrc/mustache.mjml
An email and html templating crossover
https://github.com/eugenioclrc/mustache.mjml
Last synced: 1 day ago
JSON representation
An email and html templating crossover
- Host: GitHub
- URL: https://github.com/eugenioclrc/mustache.mjml
- Owner: eugenioclrc
- Created: 2020-08-21T17:32:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-27T17:21:03.000Z (almost 4 years ago)
- Last Synced: 2024-12-04T18:44:39.225Z (19 days ago)
- Language: JavaScript
- Size: 557 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mustache.mjml
> An email & html templating crossover.
---
# Introduction
`MJML` is a markup language created by [Mailjet](https://www.mailjet.com/) and designed to reduce the pain of coding a responsive email. Its semantic syntax makes the language easy and straightforward while its rich standard components library shortens your development time and lightens your email codebase. MJML’s open-source engine takes care of translating the `MJML` you wrote into responsive HTML.
[Mustache](http://mustache.github.com/) is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object.
`Mustache.mjml` is a combination of both worlds.
## Install
You can get Mustache.mjml via [npm](http://npmjs.com).
```bash
$ npm install mustache.mjml --save
```## Usage
Below is a quick example how to use mustache.mjml:
```js
import mustacheMjml from 'mustache.mjml';const { template, errors } = mustacheMjml(`
Hello {{name}}, its time! {{now}}
`);console.log('template warnings', errors);
const view = {
name: "Joe",
now: function () {
return new Date();
}
};const output = template(view);
```### Loops