I am making a discord economy bot in javascript. I have a JSON which saves every user's data. The system used is:
It works fine, but if 2 users have the file open and both of them edit their copy of the json and then overwrite the json, the second user will overwrite the first user's data. I thought about using a DB but it's too much work to change everything so i wanted to just do something that only modifies the part of the right user, how can i do that?