Append to (update) JSON file in a local directory using JavaScript on a locally hosted web server [closed]

How can I go about updating a local JSON file for a website I am running locally?

This JSON file is the same directory as the html and javascript files, and is first fetched and used to populate a table on the website. Scanning a custom QR code (with url parameters decoded), adds an item into this table. I want to then convert that table back into a json object and append it to the local JSON file.