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
Post a Comment