property BunModules.fs

Synchronous file-system operations (compatible with node:fs).

Properties

optional
createReadStream: (
path: string,
options?: { start?: number; end?: number; }
) => NodeJS.ReadableStream | null

Methods

readFileSync(path: string): Uint8Array
realpathSync(path: string): string
writeFileSync(
path: string,
): void
statSync(path: string): { size: number; mtime: Date; isFile(): boolean; isDirectory(): boolean; }
readdirSync(path: string): string[]
mkdirSync(
path: string,
options?: { recursive?: boolean; }
): string | undefined
rmSync(
path: string,
options?: { recursive?: boolean; }
): void

Usage

import { type BunModules } from "runtime/src/index.ts";