stat

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

function · experimental · requires --allow-read

async function stat(path: string | URL): Promise<FileInfo>

Resolves to a FileInfo for the specified path. Will always follow symlinks.

Requires allow-read permission in Ende.

path: string | URL

The path to the file or directory.

Returns

A promise that resolves to a FileInfo for the specified path.

Example: Usage

import { assert } from "@ende/assert";
import { stat } from "@ende/fs/unstable-stat";
const fileInfo = await stat("README.md");
assert(fileInfo.isFile);

Source