MJML2JSON
Purpose
Converts a MJML template from an XML
syntax to a valid JSON
syntax.
Installation
npm install
Optional: if you get an error like command not found: babel-node
when running it, run npm install babel-cli -g
.
Usage
Input and output filenames must be set, both with their extensions. Use the -s
optional argument to stringify the output (and make it compatible with the MJML API).
babel-node mjml2json.js input output [-s]
You can run a test on the provided styleguide with npm run test
.
JSON2MJML
If you need to convert a MJML template from a JSON
syntax to a valid XML
syntax, check JSON2MJML.