Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/cli/dts/lib.deno.ns.d.ts>Deno.WriterSync

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface Deno.WriterSync
import { type Deno } from "https://deno.land/x/deno@v1.28.0/cli/dts/lib.deno.ns.d.ts";
const { WriterSync } = Deno;

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

Methods

writeSync(p: Uint8Array): number

Writes p.byteLength bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= p.byteLength) and any error encountered that caused the write to stop early. writeSync() must throw a non-null error if it returns n < p.byteLength. writeSync() must not modify the slice data, even temporarily.

Implementations should not retain a reference to p.