title: node.js readline: "TypeError: rl is not iterable"
body: <p>When I try to run my code I get this error:</p>
  <pre><code>file:///C:/Users/rb03/Documents/Testing/connect.js:27
  for (const line of rl) {
                     ^
  
  TypeError: rl is not iterable
      at file:///C:/Users/rb03/Documents/Testing/connect.js:27:24
      at Connection.&lt;anonymous&gt; (C:\Users\rb03\Documents\Testing\node_modules\mysql2\lib\connection.js:777:13)
      at Object.onceWrapper (node:events:514:26)
      at Connection.emit (node:events:394:28)
      at ClientHandshake.&lt;anonymous&gt; (C:\Users\rb03\Documents\Testing\node_modules\mysql2\lib\connection.js:121:14)
      at ClientHandshake.emit (node:events:394:28)
      at ClientHandshake.execute (C:\Users\rb03\Documents\Testing\node_modules\mysql2\lib\commands\command.js:44:10)
      at Connection.handlePacket (C:\Users\rb03\Documents\Testing\node_modules\mysql2\lib\connection.js:456:32)
      at PacketParser.onPacket (C:\Users\rb03\Documents\Testing\node_modules\mysql2\lib\connection.js:85:12)
      at PacketParser.executeStart (C:\Users\rb03\Documents\Testing\node_modules\mysql2\lib\packet_parser.js:75:16)
  </code></pre>
  <p>My code is as follows:</p>
  <pre><code>connection.connect(function(err) {
      if (err) throw err;
      console.log('Connected!');
  
      const rl = readline.createInterface({ input: fs.createReadStream('./Logs/Outputs/split.lines.txt') });
  
      let total = 0;
      let buff = [];
      for (const line of rl) {
          buff.push([line]);
          total++;
          if (buff.length % 2000 === 0) {
              connection.query(&quot;INSERT INTO test (line, timestamp, errortype) VALUES ?&quot;);
              console.log(total);
              buff = [];
          };
      };
  
      if (buff.length &gt; 0) {
          connection.query(&quot;INSERT INTO test (line, timestamp, errortype) VALUES ?&quot;);
          console.log(total);
      };
  
      connection.end();
  });
  </code></pre>
  <p>Anyone got any idea what to do? Google shows nothing for &quot;rl is not iterable&quot;, only for &quot;rl is not async iterable&quot;</p>
  <p>Thanks in advance!</p>