title: How to create and update a text file using React.js?
body: <p>I am trying to save a variable's data into a text file and update the file every time the variable changes. I found solutions in Node.js and vanilla JavaScript but I cannot find a particular solution in React.js.<br>
  Actually I am trying to store Facebook Long Live Access Token in to a text file and would like to use it in the future and when I try importing 'fs' and implementing createFile and appendFile methods I get an error saying <strong>Method doesn't exist</strong>.<br>
  Please help me out. Here is the code below  </p>
  
  <pre><code>window.FB.getLoginStatus((resp) =&gt; {
  
          if (resp.status === 'connected') {
              const accessToken = resp.authResponse.accessToken;
              try {
                  axios.get(`https://graph.facebook.com/oauth/access_token?client_id=CLIENT_id&amp;client_secret=CLIENT_SECRET&amp;grant_type=fb_exchange_token&amp;fb_exchange_token=${accessToken}`)
                      .then((response) =&gt; {
                          console.log("Long Live Access Token " + response.data.access_token + " expires in " + response.data.expires_in);
                          let longLiveAccessToken = response.data.access_token;
                          let expiresIn = response.data.expires_in;
                      })
                      .catch((error) =&gt; {
                          console.log(error);
                      });
              }
              catch (e) {
                  console.log(e.description);
              }
          }
  
      });
  </code></pre>