title: How can I get the data from the csv-parser?
body: <p>I want to work with the data from a csv file and I have used csv-parser to do that.</p>
  <pre><code>const csv = require('csv-parser')
  const fs = require('fs')
  const results: any[] = [];
  
  var value = fs.createReadStream('file.csv')
    .pipe(csv())
    .on('data', (data: any) =&gt; results.push(data))
    .on('end', () =&gt; {
      console.log(results);
      return results;
  
    });
  </code></pre>
  <p>The parser works well and I get the csv printed, but I want to return the data in the value variable.</p>
  <p>What should I do?</p>