jsonを読み込み、値をテンプレートに当て込みhtmlに挿入します
const fs = require('fs'); const { execSync } = require('child_process'); const ejs = require('ejs'); const template = fs.readFileSync('./template.html', 'utf-8'); const data = JSON.parse(fs.readFileSync('./data.json', 'utf-8')); const html = ejs.render(template, data); fs.writeFileSync('./index.html', html); execSync('open index.html');