fs readfile not working

JavaScript
const content = fs.readFileSync('./Index.html', 'utf8');
console.log(content);
fs.readFile('filename', function read(err, data) {
    if (err) {
        throw err;
    }
    var content = data;
  
    console.log(content);  
   
});
Source

Also in JavaScript: