Once it is released, my streamToFrequencies generator won't be needed.
Also, createReadStream only reads the file in 256 byte chunks at a time (or whatever you set the highwatermark to be, it does not read the entire file into memory. readFile would, however.
Readline doesn't work with async iterators and
for awaityet, but it just landed in 11.x staging.Once it is released, my
streamToFrequenciesgenerator won't be needed.Also,
createReadStreamonly reads the file in 256 byte chunks at a time (or whatever you set thehighwatermarkto be, it does not read the entire file into memory.readFilewould, however.To read more about async iterators and generators and the
for awaitsyntax, check out 2ality.com/2018/04/async-iter-node...Thanks a bunch @mattmorgis !