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.
Let's say that I have data.json

And I would like to add a new entry to this file.
I use the basic 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);
}
As results I have an error message:
"TypeError: fs.writeFileSync is not a function"
How do I resolve this?
fsis a Node.js module, are you sure you can use it in Vue?