Skip to content

Commit

Permalink
Create ejs.js
Browse files Browse the repository at this point in the history
  • Loading branch information
0xScratch authored Oct 17, 2023
1 parent 8fc2613 commit 3b2b73a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions npm_Modules/EJS/ejs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const ejs = require('ejs');

// Define the template
const template = `
<h1>Welcome, <%= name %>!</h1>
<p>Your favorite color is <%= color %> and your age is <%= age %> years old.</p>
`;

// Data to be passed to the template
const data = {
name: 'John Doe',
color: 'blue',
age: 30,
};

// Render the template with the data
const renderedTemplate = <link>ejs</link>.render(template, data);

// Output the rendered template
console.log(renderedTemplate);

0 comments on commit 3b2b73a

Please sign in to comment.