Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function writeBuffer
import { writeBuffer } from "https://deno.land/std@0.105.0/node/internal_binding/fs.ts";

Write to the given file from the given buffer asynchronously.

Implements async part of WriteBuffer in src/node_file.cc See: https://github.com/nodejs/node/blob/e9ed113/src/node_file.cc#L1818

Parameters

_fd: number

file descriptor

_buffer: Uint8Array

the data to write

_offset: number

where in the buffer to start from

_length: number

how much to write

_position: number | null

if integer, position to write at in the file. if null, write from the current position

optional
_callback: (err: Error, n: number) => void

callback function