Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

std/io/types.d.ts>Writer

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
interface Writer
Deprecated
Deprecated

(will be removed in 1.0.0) Use WritableStream instead.

import { type Writer } from "https://deno.land/std@0.209.0/io/types.d.ts";

An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource asynchronously.

Methods

write(p: Uint8Array): Promise<number>

Writes p.byteLength bytes from p to the underlying data stream. It resolves to the number of bytes written from p (0 <= n <= p.byteLength) or reject with the error encountered that caused the write to stop early. write() must reject with a non-null error if would resolve to n < p.byteLength. write() must not modify the slice data, even temporarily.

Implementations should not retain a reference to p.