Runtime-agnostic file system operations. Absent on runtimes without file system access (edge platforms).
readFile(path: string): Promise<Uint8Array>
Reads a file.
Resolves a path to its canonical absolute form, following symlinks.
Optional: absent on runtimes/adapters that cannot canonicalize paths. Callers MUST degrade gracefully when it is not provided (e.g. fall back to lexical containment) — see the static-asset handler in the React Router plugin, which uses it for symlink-safe containment when available.
writeFile(path: string,data: Uint8Array): Promise<void>
Writes a file, creating it if absent.
Removes a file or directory.
readStream(path: string,options?: { readonly start?: number; readonly end?: number; }): Promise<ReadableStream<Uint8Array>>
Reads a file as a stream, optionally with byte range.
Optional: absent on runtimes/adapters that do not support streaming reads.
Callers MUST degrade gracefully when it is not provided (e.g. fall back to
reading the entire file via readFile).
The end offset is INCLUSIVE, matching both node:fs createReadStream and
HTTP Range semantics.