The appendFileSync() method is used to add new content to an existing file.
const fs = require("fs"); fs.appendFileSync( "student.txt", "\nThis is new content." ); console.log("Content appended successfully.");