📅  最后修改于: 2022-03-11 15:03:39.158000             🧑  作者: Mango
// Asynchronously:
const fs = require('fs');
fs.appendFile('message.txt', 'data to append', function (err) {
if (err) throw err;
console.log('Saved!');
});
// Synchronously:
const fs = require('fs');
fs.appendFileSync('message.txt', 'data to append');