A simple stream to async iterator
npm i streams-to-async-iterator
import toAsync from 'streams-to-async-iterator';
const stream = fs.createReadStream(filename);
const asyncStream = toAsync(stream);
for await (const chunk of asyncStream) {
// ...
}
toAsync(stream)
stream
Readable stream