michml
TypeScript icon, indicating that this package has built-in type declarations

1.0.25 • Public • Published

michml

MichML

Build Status

Create email template with Nunjucks syntax and MJML

Installation

yarn add michml

npm install michml

How to use

You can see example in 'examples' folder.

How to use in TypeScript

const michel = new MichML();
const html = michel.pathToHTML(__dirname + "/templates/template.mjml", { template_data } })

How to use in JavaScript

const michML_module = require('michml')
const michel = new michML_module.MichML()
const html = michel.pathToHTML(__dirname + "/templates/template.mjml", { template_data } })

Configuration

You can configure MJML to HTML transformation

const options = {
    // Option to beautify the HTML output (default : false )
    beautify: boolean;
    // Option to keep comments in the HTML output ( default : true )
    keepComments: boolean;
    // Option to minify the HTML output ( default : false )
    minify: boolean;
    // Available values for the validator: 'strict', 'soft', 'skip' ( defaullt : 'soft' )
    validationLevel: "strict" | "soft" | "skip";
}
const michel = new MichML(options)

Readme

Keywords

Package Sidebar

Install

npm i michml

Weekly Downloads

22

Version

1.0.25

License

MIT

Unpacked Size

8.63 kB

Total Files

13

Last publish

Collaborators

  • damienmarchandfr