const mustache = require('mustache') const fs = require('fs') const htmlFile = process.argv[2] const exampleJson = process.argv[3] if (!htmlFile || !exampleJson) { console.log('usage: render-mustache ') return 1 } const html = fs.readFileSync(htmlFile, 'utf8') const json = fs.readFileSync(exampleJson, 'utf8') const example = JSON.parse(json) const output = mustache.render(html, example); console.log(output)