MCPcopy Create free account
hub / github.com/cloudflare/computer / readFile

Method readFile

packages/dofs/src/fs/filesystem.ts:50–61  ·  view source on GitHub ↗
(
    path: string,
    optionsOrEncoding?: "utf8" | ReadFileOptions,
  )

Source from the content-addressed store, hash-verified

48 readFile(path: string, encoding: "utf8"): Promise<string>;
49 readFile(path: string, options: ReadFileOptions): Promise<string | ReadableStream<Uint8Array>>;
50 readFile(
51 path: string,
52 optionsOrEncoding?: "utf8" | ReadFileOptions,
53 ): Promise<string | ReadableStream<Uint8Array>> {
54 // Forward through the free function's overload set. The
55 // individual overloads above let callers see the precise
56 // return type for each input shape.
57 // Cast through the union overload of the free function;
58 // the class's overloads above carry the precise return type
59 // for each input shape back to the caller.
60 return readFile(this.db, path, optionsOrEncoding as ReadFileOptions);
61 }
62
63 async stat(path: string): Promise<WorkspaceStatResult> {
64 return stat(this.db, path);

Callers

nothing calls this directly

Calls 1

readFileFunction · 0.70

Tested by

no test coverage detected