NodeJS: Does fs.appendFile support a file link, so adding is faster?

http://nodejs.org/api/fs.html#fs_fs_appendfile_filename_data_options_callback

Does fs.appendFile support file links to make uploads faster? (rather than opening / closing each entry)

What is the fastest way to write to a CSV file. I have an appendfile for writing newlines to a CSV file. Will the recording stream be faster? (if the appendfile opens the file every time)

Note: in fact, I write about 20 GB of CSV

Followup: I can confirm that createWriteStream is much faster than appendFile

+4
source share
2 answers

It seems to fs.appendFileclose the file when it finishes recording each fragment.

https://github.com/joyent/node/blob/master/lib/fs.js#L907

, , , . , , , CSV.

+3

fs.appendFile .

, fs.createWriteStream.

+3

Source: https://habr.com/ru/post/1529182/


All Articles