A
A
Artem Var2020-07-11 14:36:22
JavaScript
Artem Var, 2020-07-11 14:36:22

Connecting a JSON file to JS, how to change and overwrite?

I need to connect a json file and run it through Javascript, change it and write it back with the changes.
Tell me how to connect the JSON file locally? How to save the changed Json file?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
McBernar, 2020-07-11
@McBernar

JS in the browser can't write to files. This is what JS can do in Node.
So:
1. Install a node
2. Connect the fs module
3. Read the file, make changes, write back
The node has good documentation and a fairly simple api.

N
Nadim Zakirov, 2020-07-11
@zkrvndm

Based on the wording of the question, you will need to read a short overview lecture on the basics of JS. I'm afraid there is no specific answer to your question that would fit in one paragraph.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question