title: Find string and delete line - Node.JS
body: <p>How to read file, search for string and delete line in node.js? I have tried </p>
  
  <pre><code>var fs = require('fs')
  fs.readFile('shuffle.txt', function read(err, data) {
  if (err) {
  throw err;
  }
  
  lastIndex = function(){
  for (var i = data_array.length - 1; i &gt; -1; i--)
  if (data_array[i].match('user1'))
  return i;
  }()
  
  delete data_array[lastIndex];
  
  });
  </code></pre>