Module

x/proc/legacy/deps.ts>toWritableStream

A better way to work with processes in Deno.
Latest
function toWritableStream
import { toWritableStream } from "https://dotland.deno.dev/x/proc@0.21.9/legacy/deps.ts";

Create a {@link WritableStream} from a Writer.

Examples

Example 1

import { toWritableStream } from "https://deno.land/std@$STD_VERSION/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));

Parameters

writer: Writer
optional
unnamed 1: toWritableStreamOptions = [UNSUPPORTED]

Returns

WritableStream<Uint8Array>