title: Use fs in typescript
body: <p>I'm just trying to read a file using <code>fs.readFileSync</code>, though it seems it cannot be found.</p>
  
  <p>I made sure to declare it, added it within my constructor:</p>
  
  <pre><code>export default class Login extends React.Component&lt;LoginProps, {}&gt; {
      private webAuth: auth0.WebAuth;
      fs: any;
  
      constructor(props: any, context: any) {
          super(props, context);
          this.fs = require('fs');
          this.webAuth = new auth0.WebAuth({
              clientID: conf.auth0.clientId,
              domain: conf.auth0.domain,
              responseType: 'token id_token',
              redirectUri: `${window.location.origin}/login`
          });
      }
  [...]
  </code></pre>
  
  <p>And used it in a simple function:</p>
  
  <pre><code>verifyToken = (token) =&gt; {
  
      console.log(this.fs);
      let contents = this.fs.readFileSync('../utils/public.key', 'utf8');
      console.log(contents);
  
  }
  </code></pre>
  
  <p>But this raises an <code>Uncaught TypeError: _this.fs.readFileSync is not a function</code>. Is there a special way to include <code>fs</code> in Typescript ?</p>