(async () => { const { fetchNDJSON } = await import("/fetchNDJSON.js"); const results = []; let progress = 0; fetchJSONLD(file).then(({ response, reader }) => { const length = response.headers.get("Content-Length"); let received = 0; const onReadChunk = async chunk => { if (chunk.done) { return; } // await timeout(1000); received += chunk.value.length; results.push(chunk.value); progress = received / length; reader.read().then(onReadChunk); }; reader.read().then(onReadChunk); }); })();