title: Angular - How to check if file exists without fs
body: <p>As <code>fs</code> <a href="https://github.com/angular/angular-cli/issues/10681" rel="nofollow noreferrer">seems not to work anymore since Angular 6</a>
  I haven't found an alternative way to check if a file exists.
  In my special case I have to check if a specific image file exists in the assets folder, e.g. something like this:</p>
  
  <pre><code>if (fileExists('path')) { doSomething(); }
  </code></pre>
  
  <p>I've tried to install the <a href="https://www.npmjs.com/package/file-exists" rel="nofollow noreferrer">file-exists package</a> but this uses </p>
  
  <pre><code>const fs = require('fs')
  const path = require('path')
  </code></pre>
  
  <p>which apparently is not supported by Angular 7.</p>
  
  <p>Is there anybody who can help? Thanks a lot.</p>