Download xlsx from S3 and parse it

前端 未结 5 1679
星月不相逢
星月不相逢 2021-01-05 10:33

I need a service to download an excel file from Amazon S3, then parse with node-xlsx

The problem is that I can\'t get xlsx to parse the file. When I try to read back

5条回答
  •  执笔经年
    2021-01-05 10:50

    fs.writeFile is asynchronous. The file won't be there till the call back is called.

    https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback

    fs.writeFile('message.txt', 'Hello Node.js', (err) => {
      if (err) throw err;
      console.log('It\'s saved!');
    });
    

提交回复
热议问题