method IFileSystem.readStream
Since 0.1.0
IFileSystem.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.

Parameters

path: string

File path

optional
options: { readonly start?: number; readonly end?: number; }

Optional byte range (both start and end are inclusive)

Return Type

A readable stream of bytes

Usage

import { type IFileSystem } from "common/src/index.ts";