Skip to main content
writeFileSync - node__fs.d.ts - Node documentation
function writeFileSync

Usage in Deno

```typescript import { writeFileSync } from "node:node__fs.d.ts"; ```
writeFileSync(
data: string | ArrayBufferView,
options?: WriteFileOptions,
): void
> [!WARNING] Deno compatibility > Missing `utf16le`, `latin1` and `ucs2` encoding. Returns `undefined`. The `mode` option only affects the newly created file. See [open](../.././node__fs.d.ts/~/open) for more details. For detailed information, see the documentation of the asynchronous version of this API: [writeFile](../.././node__fs.d.ts/~/writeFile).

Parameters

filename or file descriptor
data: string | ArrayBufferView
optional
options: WriteFileOptions

Return Type

void