{"library":"mjml-cli","title":"MJML CLI","description":"The `mjml` package (which provides the `mjml-cli` functionality) is a robust, open-source framework designed to simplify the creation of responsive emails. It allows developers to build emails using a custom XML-like component language (MJML) that is then compiled into production-ready, semantic HTML, ensuring consistent rendering across various email clients. The current stable version, 5.0.1, introduces significant improvements in HTML output, minification, and security. Releases follow a steady cadence, with active development on minor versions and frequent alpha/beta cycles for major upgrades. Key differentiators include its declarative component-based approach, strong focus on email client compatibility, excellent documentation, and vibrant community support, collectively addressing the historical pain points of crafting reliable HTML emails. While the dedicated `mjml-cli` npm package is deprecated, the core `mjml` package provides the command-line interface functionality, enabling compilation, validation, and watch modes directly from the terminal.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install mjml-cli"],"cli":{"name":"mjml","version":null}},"imports":["import { mjml2html } from 'mjml';","import { MjmlError } from 'mjml';","import type { Options } from 'mjml';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"npm install mjml\n\n# Create an MJML file, e.g., 'template.mjml'\n# <mjml>\n#   <mj-body>\n#     <mj-section>\n#       <mj-column>\n#         <mj-text>Hello from MJML!</mj-text>\n#         <mj-button href=\"https://mjml.io\">Learn More</mj-button>\n#       </mj-column>\n#     </mj-section>\n#   </mj-body>\n# </mjml>\n\n# Compile MJML to HTML and output to a file\n./node_modules/.bin/mjml template.mjml -o output.html\n\n# Alternatively, if 'mjml' is globally installed or in your PATH:\nmjml template.mjml -o output.html\n\n# Watch for changes in 'template.mjml' and recompile automatically\nmjml --watch template.mjml --output watch-output.html\n\n# Compile with custom options: minify HTML and specify CSS minification preset\nmjml template.mjml --config.minify true --config.minifyOptions='{\"minifyCss\": \"default\"}' -o minified.html","lang":"bash","description":"Demonstrates how to install the `mjml` package and use its command-line interface to compile an MJML file to HTML, including watching for file changes and applying custom minification options.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}