Created
June 8, 2023 04:55
-
-
Save rayepeng/91c857f108b9ff610055e42bfe6e68b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ejs | |
const ejs = require('ejs'); | |
// define our template | |
const template = ` | |
<h1>Hello, <%= name %>!</h1> | |
`; | |
// render it | |
const data = { name: 'John' }; | |
const html = ejs.render(template, data); | |
console.log(html); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment