below is the code snippet for it
const fs = require('fs');
fs.appendFile('messages.txt', 'data to append', function(error) {
if(!err) {
console.log('Appended to file');
}
});
references:
https://stackoverflow.com/questions/3459476/how-to-append-to-a-file-in-node
const fs = require('fs');
fs.appendFile('messages.txt', 'data to append', function(error) {
if(!err) {
console.log('Appended to file');
}
});
references:
https://stackoverflow.com/questions/3459476/how-to-append-to-a-file-in-node
No comments:
Post a Comment