Monday 30 July 2018

Reading Large Excel Files with SheetJS/js-xlsx?

I am using this package: https://www.npmjs.com/package/xlsx

However I can have some very large excel files that could contain 1 million rows.

I tested with 600K rows which is about 15mb excel file and my code is already crashing on localhost.

Is there away to stream it in? I know the documentation says they don't have any sort of streaming api but it talks about buffering?

 var reader = new FileReader();
    reader.onload = evt => {
      const bstr = evt.target.result;
      const wb = XLSX.read(bstr, { type: "binary" });
      const wsname = wb.SheetNames[0];
      const ws = wb.Sheets[wsname];
      const data = XLSX.utils.sheet_to_json(ws, { header: "A", defval: "" });
      });
    };
    reader.readAsBinaryString(this.file);



from Reading Large Excel Files with SheetJS/js-xlsx?

No comments:

Post a Comment