writeFile
doesn't need a close
method because it opens/writes/closes the file all in a single call.
The main criteria do decide between the two is not the presence/need of an explicit close
but rather: does the data fit easily in RAM? If it does, then writeFile
is certainly simpler to use (and potentially a slightly bit faster); else, you better use streams and write data in chunks.