var content; fs.readFile(\'./Index.html\', function read(err, data) { if (err) { throw err; } content = data; }); console.log(content); >
var content; fs.readFile(\'./Index.html\', function read(err, data) { if (err) { throw err; } content = data; }); console.log(content);
This line will work,
const content = fs.readFileSync('./Index.html', 'utf8'); console.log(content);