Deprecated
(will be removed after 1.0.0) Use {@link WritableStreamDefaultWriter
} directly.
import { writerFromStreamWriter } from "https://dotland.deno.dev/x/dax@0.39.2/src/deps.ts";
Create a {@link Writer
} from a {@link WritableStreamDefaultWriter
}.
Examples
Example 1
Example 1
import { copy } from "https://deno.land/std@$STD_VERSION/io/copy.ts";
import { writerFromStreamWriter } from "https://deno.land/std@$STD_VERSION/streams/writer_from_stream_writer.ts";
using file = await Deno.open("./deno.land.html", { read: true });
const writableStream = new WritableStream({
write(chunk): void {
console.log(chunk);
},
});
const writer = writerFromStreamWriter(writableStream.getWriter());
await copy(file, writer);