import { toWritableStream } from "https://deno.land/std@0.224.0/io/to_writable_stream.ts";
Create a WritableStream
from a Writer
.
Examples
Example 1
Example 1
import { toWritableStream } from "https://deno.land/std@0.224.0/io/to_writable_stream.ts";
const file = await Deno.open("./file.txt", { create: true, write: true });
await ReadableStream.from("Hello World")
.pipeThrough(new TextEncoderStream())
.pipeTo(toWritableStream(file));
Returns
WritableStream<Uint8Array>