Here is a simple function to convert async iterator to an array without having to include a whole package.
async function toArray(asyncIterator){
const arr=[];
for await(const i of asyncIterator) arr.push(i);
return arr;
}
Here is a simple function to convert async iterator to an array without having to include a whole package.
async function toArray(asyncIterator){
const arr=[];
for await(const i of asyncIterator) arr.push(i);
return arr;
}