可參考這篇:
https://stackoverflow.com/questions/2496710/writing-files-in-node-js
var fs = require('fs');
fs.writeFile("/tmp/test", "Hey there!", function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
可以參考這篇文章用 winston https://itw01.com/3IINEPG.html