I am trying to write to the end of a file when given the absolute path. So far, I have got this
let data = '/Users/me/Documents/'
const fs = require("fs");
let proxy = 'this is a proxy'
let dir = `${data}/hello/world/built.conf'`
fs.writeFile(dir, proxy, {'flag': 'a'}, function(err) {
if (err) {
return console.error(err);
}});
but never actually appends to the end of the file. I have added the flag to append at the end of the file. Any sort of help is appreciated! Thanks in advance for any help in regards to this.