Answers for "when using the fs.writefile in node how can you test to see if its working?"

18

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

Code answers related to "when using the fs.writefile in node how can you test to see if its working?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language