title: WriteStream doesn't write all data
body: <p>1st I read in a file line by line with my code. (Round about 1650 lines in the file)</p>
  
  <p>2nd I reformate each line of the file into many lines.</p>
  
  <p>3rd I would like to write the output in a new file. Unfortunately it doesn't write all of the more than 16800 lines. The output varied round about 15500 lines.</p>
  
  <p>For 3rd I use folling code:</p>
  
  <pre><code>var inputArr; //Splited Input of one line 
  var Text; //inputArr transformed to a String with many lines (per start line)
  var lineCounter = 0; //counts the expacted number of output lines
  
  const fs = require('fs');
  const writeStream = fs.createWriteStream('./output.txt');
  
  for(var i=0; i&lt;= inputArr.length; i++) {
    writeStream.write(Text);
  
    lineCounter = lineCounter + 1;
  }
  
  writeStream.end();
  </code></pre>
  
  <p>What can I do to write all lines into my output file?</p>