Reading files can't be that hard, right?

from blog nickb.dev, | ↗ original
Let’s create a file input and chunk into 4MB chunks input type="file" onchange="processFile(...arguments)" /> script> const CHUNK_SIZE = 4 * 1024 * 1024; function processFile(e) { const file = e.currentTarget.files[0]; const start = performance.now(); const fileSize = file.size; for (let i = 0; i fileSize; i += CHUNK_SIZE)...