Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/lib.deno.d.ts>Deno.Writer

A JavaScript extension package for building strong and modern applications.
Latest
interface Deno.Writer
Deprecated
Deprecated

This will be removed in Deno 2.0. See the Deno 1.x to 2.x Migration Guide for migration instructions.

import { type Deno } from "https://deno.land/x/ayonli_jsext@v0.9.72/lib.deno.d.ts";
const { Writer } = Deno;

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.

This function is one of the lowest level APIs and most users should not work with this directly, but rather use writeAll() from std/streams/write_all.ts instead.

Implementations should not retain a reference to p.