How to append to a file in Node?

后端 未结 18 1476
庸人自扰
庸人自扰 2020-11-22 09:23

I am trying to append a string to a log file. However writeFile will erase the content each time before writing the string.

fs.writeFile(\'log.txt\'         


        
18条回答
  •  野性不改
    2020-11-22 10:20

    Using jfile package :

    myFile.text+='\nThis is new line to be appended'; //myFile=new JFile(path);
    

提交回复
热议问题