认证高级PHP讲师
Because it’s asynchronous
fs.appendFile Asynchronous, please use fs.appendFileSync
fs.appendFile
fs.appendFileSync
https://nodejs.org/api/fs.htm...
It is recommended that you concatenate the strings before writing them to the file. . .
Most nodejs file operation APIs are divided into asynchronous/synchronous (fs.xxx/fs.xxxSync). Just change it to synchronized function content.
Because it’s asynchronous
for synchronizationfs.appendFile
Asynchronous, please usefs.appendFileSync
https://nodejs.org/api/fs.htm...
It is recommended that you concatenate the strings before writing them to the file. . .
Most nodejs file operation APIs are divided into asynchronous/synchronous (fs.xxx/fs.xxxSync). Just change it to synchronized function content.