npm.io
1.0.1 • Published 6 years ago

maketextfilelineiterator

Licence
MIT
Version
1.0.1
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
1

makeTextFileLineIterator

This function is an almost-verbatim rip-off from https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch for reading a remote text file line by line.

Extended slightly to pass through fetch options. Specifically, I've used this with Range for fetching portions of remote FASTA files.

Example Usage

    import makeTextFileLineIterator from 'makeTextFileLineIterator';

    for await (let line of makeTextFileLineIterator(urlOfFile)) {
        processLine(line);
    }