Use this tag for questions about asynchronously appending the given data to a file using a programing language (viz. Javascript).
It is most often used when someone wants to append content to file programmatically, such as using Javascript function fs.appendFile( path, data[, options], callback ), one can be able to asynchronously append the given data to a file. A new file is created if it does not exist. The options parameter can be used to modify the behavior of the operation.
e.g. Example in Node.JS
// Node.js program to demonstrate the
// fs.appendFile() method
// Import the filesystem module
const fs = require('fs');
// Get the file contents before the append operation
console.log("\nFile Contents of file before append:",
fs.readFileSync("example_file.txt", "utf8"));
fs.appendFile("example_file.txt", "World", (err) => {
if (err) {
console.log(err);
}
else {
// Get the file contents after the append operation
console.log("\nFile Contents of file after append:",
fs.readFileSync("example_file.txt", "utf8"));
}
});