createSync

import { createSync } from "jsr:@ende/fs/unstable-create";

function · experimental · requires --allow-read, --allow-write

function createSync(path: string | URL): FsFile

Creates a file if none exists or truncates an existing file and returns an instance of FsFile.

Requires allow-read and allow-write permissions.

path: string | URL

The path to the newly created file.

Returns

A FsFile instance.

Example: Usage

import { createSync } from "@ende/fs/unstable-create";
const file = createSync("/foo/bar.txt");

Source