I'm developing electron app for the first time. I use function in .js file to find all files in folder and to write all of them to console.
fs.readdir(save_path, function(err, files) {
if (err) {
} else {
for(let projectFile of files)
{
fs.readFile(save_path+"\\"+projectFile, function(err, data)
{
if(data != null)
{
console.log(projectFile);
}
});
}
}
});
But is there any way to send this projectFile variable to html page? Because there is for loop, so I need to use for loop in html too I guess.
<div class="col-sm-3 text-center" style="background: #34495e; height:2160px;">
<p class="b wh" style="margin-top: 15%;">Latest projects</p>
<!-- Projects should be displayed here. I guess there should be some kind of for loop -->
<hr class="divider">
</div>
Thank you!