xhr-readline
Read large XMLHttpRequests line by line. This package enables parsing of contents as soon as they come in over the wire.
should tell you what you need to know ;)
const url = '/assets/test.lines';const xhr = ;xhr;;xhr;
since you pass in the xhr object, you retain control over it and can e.g. abort the request at any time.
Benchmark Idea
If you can spare the time, it would be interesting to see how memory consumption and speed is affected by using this function vs waiting for all the data to be completed and then just using split('\n')
.