Can I, using JavaScript client side code, 'on the fly' generate a large file and stream it to disk? This would be to avoid memory / performance issues. Currently I'm creating an in-memory zip file to hold my sample data. But in the real world the file size could easily be 5Gb+. i.e. After which I suspect the in-memory solution won't cut it.
StreamSaver.js is the best solution I've come across. It allows you to stream large amounts of data. So far I've test a 20 Gb download. But I've noticed, while it runs fine on a Macbook Pro 2018, it caused performance issues on a Macbook Pro 2015. I'm going to continue to evaluate.
Update (27/11/2019): It's been nearly a year since I asked this question. In short the above became a blocking issue for us. We realized browsers cannot, in their current form, be used to stream to disk. Instead we moved to a client side application built using Electron. This client has been used to download reports of up to 0.5 TB which the browse could not support.