Solution:
search_word.js
var fs=require('fs');
fs.readFile('C:/Users/Public/node_prog/searchf.txt', function (err, data) {
if (err) throw err;
if(data.includes('dfgdf')){
console.log(data.toString())
}
else
{
console.log('word not found');
}
});
Initiate search_word.js:
C:\Users\Your Name>node search_word.js
0 Comments