use fs.readfile inside of a function code example
Example: fs readfile not working
const content = fs.readFileSync('./Index.html', 'utf8');
console.log(content);
const content = fs.readFileSync('./Index.html', 'utf8');
console.log(content);