Created
June 8, 2023 05:00
-
-
Save rayepeng/5725007a95f927d5fe7ab97311f23576 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install handlebars | |
const handlebars = require('handlebars'); | |
// define template | |
const template = ` | |
<h1>Hello, {{name}}!</h1> | |
`; | |
// more progress, compile template | |
const compiledTemplate = handlebars.compile(template); | |
// render template | |
const data = { name: 'John' }; | |
const html = compiledTemplate(data); | |
console.log(html); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment