Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/js/lib.deno_runtime.d.ts>__io.toAsyncIterator

A modern runtime for JavaScript and TypeScript.
Go to Latest
function __io.toAsyncIterator
import { __io } from "https://deno.land/x/deno@v0.30.0/cli/js/lib.deno_runtime.d.ts";
const { toAsyncIterator } = __io;

UNSTABLE: Make Reader into AsyncIterable? Remove this?

Turns r into async iterator.

 for await (const chunk of toAsyncIterator(reader)) {
     console.log(chunk)
 }

Returns

AsyncIterableIterator<Uint8Array>