title: How to store data from reading lines in nodejs
body: <p>Hello I have external txt file with data to my function. How can I store read line to variable</p>
  <pre><code>const fs = require(&quot;fs&quot;);
  const readline = require(&quot;readline&quot;);
  const firstVariable; [it is firstLine]
  const secondVariable; [it is secondLine]
  const thirdVariable; [it is thirdLine]
  const fourthVariable; [it is fourthLine]
  
  const readInterface = readline.createInterface({
    input: fs.createReadStream(&quot;./slo1.in&quot;),
    output: process.stdout,
    terminal: false,
  });
  
  readInterface.on(&quot;line&quot;, function (line) {
    console.log(line);
  });
  </code></pre>