Is it possible to have FS write to a newline in a .txt file each time the function is called? I have tried \n like in the following example and it doesn’t seem to work:
for(let i = 0; i < 5; i++){
fs.writeFile('./file.txt', '\n '+ i.toString(),(error) => {
if(error){
console.log(error)
}else{
console.log('success')
}
})
}
‘smart quotes’
are not valid strings.'smart quotes'
?