I have to write a lot of files and I'm wondering which method suits best. The data are text.
I'm a bit concerned on how I can close properly the operation. createWriteStream
has a end()
method or fs.close()
, which closes the stream; writeFile
has no such method if I well-understood, which may be inefficient after a long batch of write. All the examples of fs.writeFile never mention fs.close()
.