truncate - Node documentation
function truncate

Usage

import { truncate } from "node:fs/promises";

Truncates (shortens or extends the length) of the content at path to lenbytes.

Parameters

path: PathLike
optional
len: number = 0

Return Type

Promise<void>

Fulfills with undefined upon success.