Module

std/node/fs.ts>writeSync

Deno standard library
Go to Latest
function writeSync
import { writeSync } from "https://dotland.deno.dev/std@0.177.0/node/fs.ts";

If buffer is a plain object, it must have an own (not inherited) toStringfunction property.

For detailed information, see the documentation of the asynchronous version of this API: write.

Parameters

fd: number
buffer: ArrayBufferView
optional
offset: number | null
optional
length: number | null
optional
position: number | null

Returns

number

The number of bytes written.

Synchronously writes string to the file referenced by the supplied file descriptor, returning the number of bytes written.

Parameters

fd: number

A file descriptor.

string: string

A string to write.

optional
position: number | null

The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.

optional
encoding: BufferEncoding | null

The expected string encoding.

Returns

number
import writeSync
import { writeSync } from "https://dotland.deno.dev/std@0.177.0/node/fs.ts";