March 4, 2022 . 1 MIN READ
function processInput ( text )
{
fs.open(‘H://log.txt’, ‘a’, 666, function( e, id ) {
fs.write( id, text + “\n”, null, ‘utf8’, function(){
fs.close(id, function(){
console.log(‘file is updated’);
});
});
});
}
Reference: https://stackoverflow.com/questions/10384340/how-to-append-to-new-line-in-node-js