Is there a reason why this code doesn't work? additionally using node file.js responds MODULE_NOT_FOUND.
const fs = require('fs');
// Create the "text.txt" file with the content "hello world"
fs.writeFileSync('text.txt', 'hello world');
// Add additional text to the end of the file
fs.appendFileSync('text.txt', '\nThis is additional text.');
console.log('Hello, World!');