title: Append lines after match
body: <p>How to print eg 5 lines after a match? Would like to use similar to below:</p>
  
  <pre><code>var error="1234";
  
  fs.readFileSync('errors.txt').toString().split('\n').forEach(function(line){
      var idx = line.match(error);
      if (idx !== null) {
          fs.appendFileSync(result.txt, line + "\n");
      }
  });
  </code></pre>
  
  <p>Which gives me only matching line.
  My goal is to append matching and 5 succeeding lines or even better all lines between 2 matches. </p>