ai-from-stream

create an async iterable from a stream
This module convert an instance of readable node Stream into an async iterable.
Usage
Write content of a file in a for loop:
import fromStream from ".";
import { createReadStream } from "fs";
const stream = createReadStream(`file.txt`, "utf8");
for await (const chunk of fromStream(stream)) {
console.log(chunk);
}
This will output the content of file.txt
file
API
aiFromStream
Create an async iterable from a stream
Parameters
stream
ReadableStream the stream to transform
Returns AsyncIterable converted iterator
Install
With npm installed, run
npm install --save ai-from-stream
See Also
License
MIT