Render with Data
let ejs = require('ejs');
let people = ['geddy', 'neil', 'alex'];
let tpl = '<%= people.join(", "); %>';
let html = ejs.render(tpl, {people: people});
console.log(html);
Pass EJS a template string and some data.
Comments
let ejs = require('ejs');
let people = ['geddy', 'neil', 'alex'];
let tpl = '<%= people.join(", "); %>';
let html = ejs.render(tpl, {people: people});
console.log(html);
Pass EJS a template string and some data.