diff --git a/npm_Modules/EJS/ejs.js b/npm_Modules/EJS/ejs.js new file mode 100644 index 0000000..f7f1a74 --- /dev/null +++ b/npm_Modules/EJS/ejs.js @@ -0,0 +1,20 @@ +const ejs = require('ejs'); + +// Define the template +const template = ` +

Welcome, <%= name %>!

+

Your favorite color is <%= color %> and your age is <%= age %> years old.

+`; + +// Data to be passed to the template +const data = { + name: 'John Doe', + color: 'blue', + age: 30, +}; + +// Render the template with the data +const renderedTemplate = ejs.render(template, data); + +// Output the rendered template +console.log(renderedTemplate);