create txt in fs code example
Example 1: data not write in file node js
const fs = require('fs');
fs.readFile('file.txt', 'utf-8', (err, data) => {
if(err) {
throw err;
}
console.log(data);
});
Example 2: fs create or edit file
//Edit file or creates if doesnt exist
const fs = require('fs');
fs.appendFile(‘<fileName>’,<content>,callbackFunction)