I’m using the following to try to write to a file named output.txt;
fs.writeFile('./output.txt', 'New Request Processed', (err) => {
//In case of a error throw err.
if (err) throw err;
})
the only problem is when I execute this block of code, nothing happens. No error messages and the file is blank. Any ideas on why this might be happening?
This works, but is there a way to handle this so that I don’t have to run refresh every time to see updates to the file? I’m going to be writing to it repeatedly.
You can probably see them without using refresh, by having it being returned by an express GET request. But I don’t think editing can be done, unfortunately…