title: Reading only modified data
body: <p>In my project, i am using <code>fs.watchFile</code> for listening to the modification of the text file.</p>
  
  <p><strong>Requirement</strong>
  Read only the last updated data </p>
  
  <p><strong>Note</strong> In text file data is always added, no deletion.</p>
  
  <p><strong>Sample code</strong> </p>
  
  <pre><code>fs.watchFile(config.filePath, function (curr, prev) {
          fs.readFile(config.filePath, function (err, data) {
                if (err) throw err;
              console.log(data);
          });
   });
  </code></pre>
  
  <p>Above code reads whole text file when the file is modified.</p>
  
  <p>Any suggestion will be greatful.</p>
  
  <p><strong>Working Code</strong></p>
  
  <pre><code>fs.watchFile(config.filePath, function (curr, prev) {
  var filestream = fs.createReadStream(config.filePath,{start:prev.size,end:curr.size,encoding:"utf-8");
      filestream.on('data', function (data) {
           console.log(data);
    });
  });
  </code></pre>