var file = require('./data.json')
console.dir(file.products['1234'].states['STATEA']);
file.products['1234'].states['STATEA']=5;
console.dir(file.products['1234'].states['STATEA']);
It seems to work, but after stopping the nodejs app and looking into the file there is no change in the file.
I tried different things but I didn't find a solution. I think the problem is while running the app I only work on a copy of the file and not on the original file...
I want to store the states in the file for a longer time. Later I want to use a database instead a json file.
Thanks for help! :)