title: Node.js fs workaround
body: <p>I'm using node and webpack to run a UI I've been designing on react. Some of the packages I use require fs - functions like <code>fs.readFileSync(__dirname + '/file.txt');</code> return a missing type error.</p>
  
  <p>I've read that fs tries to access the file system which won't work on a browser due to privacy concerns. This is understandable.</p>
  
  <p>What is the best explicit alternative ie. when I download a package (for example <code>npm install pdf-kit --s</code>) and it doesn't work due to using fs, what can I do to make it work?</p>
  
  <p>Thanks</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I've tried adding <code>"target": "node"</code> and   </p>
  
  <pre><code>node: {
    fs: 'empty',
  }
  </code></pre>
  
  <p>to webpack config, both to no avail. The specific error I am getting is </p>
  
  <p><code>TypeError: fs.readFileSync is not a function</code></p>
  
  <p>Very keen for a specific workaround - not sure how to work with these packages that have fs...</p>