title: Differences between Node.js and React.js applications
body: <p>I have a section of code in javascript that looks like this:</p>
  
  <pre><code>var fs = require('fs');
  
  var subscriptions = []
  
  var array = fs.readFileSync('optimal.csv', 'utf8').toString().split("\r");
  for (i in array) {
      stock = array[i].split(':')[0];
      if (stock)
          subscriptions.push(stock)
  }
  </code></pre>
  
  <p>When I say:</p>
  
  <pre><code>node .\realtime.js
  </code></pre>
  
  <p>it has no problem reading the file 'optional.csv'.</p>
  
  <p>However, if I copy the same section of code to a <code>react.js</code> application built with <code>create-react-app</code> and try to run it, I get errors:</p>
  
  <pre><code>TypeError: fs.readFileSync is not a function
  </code></pre>
  
  <p>when I run it thus:</p>
  
  <pre><code>npm run start
  
  var fs = require('fs');
  
  // Grid data as an array of arrays
  const quoteList = [];
  var i = 0;
  var stock;
  
  var array = fs.readFileSync('optimal.csv').toString().split("\r");
      for (i in array) {
          stock = array[i].split(':')[0];
          if (stock)
              quoteList.push(stock)
      }
  </code></pre>
  
  <ul>
  <li><strong>What is the correct way to read a <code>.csv</code> file from a purely react application?</strong></li>
  </ul>