title: Update local JSON file in Vue.js
body: <p>I am pretty new in Vue.js and I faced with the issue, that I can't update/write some data in my local JSON file.</p>
  <p>Let's say that I have data.json
  <a href="https://i.stack.imgur.com/GZKh5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GZKh5.png" alt="enter image description here" /></a></p>
  <p>And I would like to add a new entry to this file.</p>
  <p>I use the basic code :</p>
  <pre><code>  let d = JSON.stringify({ x: 5, y: 6 });
          const fs = require('fs');
          try { 
               fs.writeFileSync('data.json', d, 'utf-8'); 
              } 
           catch (e) 
              { 
              alert(e);
              }
  </code></pre>
  <p>As results I have an error message:</p>
  <blockquote>
  <p>&quot;TypeError: fs.writeFileSync is not a function&quot;</p>
  </blockquote>
  <p>How do I resolve this?</p>