Javascript - Download continuously data

2019-04-02 17:35发布

问题:

I have receiving data from server(10,000,000 records) continuously, no all of them in one place.(using socket.io.js)
I want download this data continuously by create Csv/Json file and retain data into HardDisk no Ram from first downloading, because size of all of records is ~2GB and I don't wish involved memory.

Notice:

  1. I used of StreamSaver.js already, but it had many problem (not suport firefox, error in downloading).
  2. Using 100 users from this app and my server has limitation in memeory/cpu.

client.js

socket.on('receive_records', function (data) {
    //Receive data 
});