Answers for "does fs.writefile overwrite"

11

fs.writefile

const fs = require('fs');

fs.writeFile("/tmp/test", "Hey there!", function(err) {
    if(err) {
        return console.log(err);
    }
    console.log("The file was saved!");
}); 

// Or
fs.writeFileSync('/tmp/test-sync', 'Hey there!');
Posted by: Guest on August-08-2020
0

write to file but dont overwrite fs.writeFile node

fs.appendFile("file.txt", 'Text',function(err){
if(err) throw err;
console.log('IS WRITTEN')
});
Posted by: Guest on April-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language