var jf = require('jsonfile');
jf.writeFile("./setting.json", newSettings, function(err) {
if (err){
console.log("writing file err: ", err);
} else {
console.log("setting saved successfully.");
}
});
Above code reports successfully in both development (npm start) and distribution (zip to app.nw and put it in node-webkit.app Resources dir), but only the file in development changed. I dont know why. Have tried utf8 and base64 encoding, both of them are the same.
Or is there a way to get around it? Like put the setting.json file somewhere else?