Download large file with node.js avoiding high memory consumption

后端 未结 6 939
梦毁少年i
梦毁少年i 2020-12-12 15:35

I`m trying to create a file downloader as a background service but when a large file is scheduled, it\'s first put in memory and then, at the end of the download the file is

6条回答
  •  臣服心动
    2020-12-12 15:43

    Instead of holding the content into memory in the "data" event listener you should write to the file in append mode.

提交回复
热议问题