node.js - JSON to backup JSON -


i want use fs backup 1 json file next heres code

function saveworld() {   (i = 0; < worlds.length; i++) {    fs.writefilesync("./save", json.stringify(worldnames), "utf8")    fs.writefilesync("./save", json.stringify(worlds), "utf8")   }  } 

and overwrites first file can me prevent this

you want second call fs.appendfile()


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -