create-iamturns-app
Version:
App generator for my projects
16 lines (12 loc) • 367 B
JavaScript
const fs = require("fs")
const ejs = require("ejs")
const renderView = (view, data) => ejs.render(view, data)
const renderViewOnFile = async (filePath, data) => {
const fileContents = fs.readFileSync(filePath, "utf8")
const view = await renderView(fileContents, data)
fs.writeFileSync(filePath, view)
}
module.exports = {
renderView,
renderViewOnFile,
}