In Node.js, I am attempting to write into the Documents
folder of the user (on macOS):
var logger = fs.createWriteStream('~/Documents/somefolderwhichexists/'+title+'.txt');
This gives me an error, but I am not sure what is wrong. The error says:
Uncaught Exception: Error: ENOENT: no such file or directory
How could I use an absolute path here? Or what is my mistake?