I\'m quite puzzled with reading files in Node.js.
fs.open(\'./start.html\', \'r\', function(err, fileToRead){
if (!err){
fs.readFile(fileToRead,
1).For ASync :
var fs = require('fs');
fs.readFile(process.cwd()+"\\text.txt", function(err,data)
{
if(err)
console.log(err)
else
console.log(data.toString());
});
2).For Sync :
var fs = require('fs');
var path = process.cwd();
var buffer = fs.readFileSync(path + "\\text.txt");
console.log(buffer.toString());