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

x/dtils/mod.ts>readStreamToFn

The best unofficial library of utilities for Deno applications
Go to Latest
function readStreamToFn
Re-export
import { readStreamToFn } from "https://deno.land/x/dtils@2.3.1/mod.ts";

Read 1streamintofn, calling fnfor every chunk. Iffn` returns a promise, it will be awaited

Parameters

stream: ReadableStream<T>
fn: (data: T) => unknown

Returns

Promise<void>