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

Usage in Deno

```typescript import { truncateSync } from "node:node__fs.d.ts"; ```
truncateSync(
path: PathLike,
len?: number | null,
): void
Truncates the file. Returns `undefined`. A file descriptor can also be passed as the first argument. In this case, `fs.ftruncateSync()` is called. Passing a file descriptor is deprecated and may result in an error being thrown in the future.

Parameters

path: PathLike
optional
len: number | null = 0

Return Type

void