Answers for "node fs write append"

7

How to append to a file in Node?

// 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');
Posted by: Guest on May-12-2020
0

nods js fs append to file

const fs = require('fs');

fs.appendFileSync('message.txt', 'data to append');
Posted by: Guest on July-07-2021
0

fs append

const fs = require('fs');

fs.appendFile('message.txt', 'data to append', function (err) {
  if (err) throw err;
  console.log('Saved!');
});
Posted by: Guest on August-03-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language