docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
Build a command-line tool that processes email templates and generates responsive HTML output with validation and error handling.
Build a CLI tool that accepts template file paths and converts them to HTML format.
Add validation mode to check templates without generating output.
Support different output formatting options for generated HTML.
Implement watch mode to automatically recompile templates when they change.
/**
* Main CLI entry point
* Processes MJML template files based on command-line arguments
*
* @param {string[]} args - Command-line arguments
* @returns {Promise<void>}
*/
async function main(args);
/**
* Processes a single template file
*
* @param {string} inputPath - Path to MJML template file
* @param {object} options - Processing options
* @param {string} [options.output] - Output file or directory path
* @param {boolean} [options.beautify] - Beautify HTML output
* @param {boolean} [options.minify] - Minify HTML output
* @returns {Promise<{success: boolean, errors: Array}>}
*/
async function processTemplate(inputPath, options);
/**
* Validates a template file without generating output
*
* @param {string} inputPath - Path to MJML template file
* @returns {Promise<{valid: boolean, errors: Array}>}
*/
async function validateTemplate(inputPath);
/**
* Watches template files for changes and recompiles
*
* @param {string[]} filePaths - Paths to template files to watch
* @param {object} options - Processing options
* @returns {Promise<void>}
*/
async function watchTemplates(filePaths, options);Provides MJML to HTML conversion functionality with validation and formatting options.