import { provide } from "https://deno.land/x/streamtools@v0.4.0/provide.ts";
Provides the given values to the writable stream by piping them from a readable stream created from the values. Returns a promise that resolves when all the values have been successfully written to the stream.
import { provide } from "./provide.ts";
const results: number[] = [];
const writer = new WritableStream<number>({
write(chunk) {
results.push(chunk);
},
});
await provide(writer, [1, 2, 3]);
console.log(results); // [1, 2, 3]