Javascript, when used by the browser, cannot perform write or read operations freely on the operating system file system.
What you could do is build a web application with some technology server-side, such as ASP.NET MVC or PHP for example, and through this application you perform write operations on that JSON file, also note that this file will be on the server side and not on the client side.
If you want to store and manipulate this JSON file on the client side you can use the File API that allows your application to interact with local files on a virtual file system, that is, you will have access to a directory that will only be of your application, within that directory you will be able to perform whatever operations you want, but you will not be able to exit from within it to access the operating system file system.
To learn more about the technologies server-side that I mentioned above, I recommend that you take a look at the site’s wiki for the ASP.NET MVC and PHP tags:
And to learn more about the File API recommend the articles below:
Herinque, as stated by zidnd, javascript cannot perform write/read operations on the client side, I advise you to use localstorage or sessionstorage to store data on the client side if this is really your intention
– Gabriel Rodrigues
@Gabrielrodrigues ...is Zignd... and not zidnd... : P
– Zignd
@Zignd this! rsrs
– Gabriel Rodrigues
I appreciate the answer, in my conception I understood that I could do this directly with javascript, I had forgotten that this was going to the server side, I appreciate the clarification.
– Marcos Henrique