MCPcopy Create free account
hub / github.com/denoland/std / readTextFileSync

Function readTextFileSync

fs/unstable_read_text_file.ts:71–83  ·  view source on GitHub ↗
(
  path: string | URL,
)

Source from the content-addressed store, hash-verified

69 * @returns The string of file content.
70 */
71export function readTextFileSync(
72 path: string | URL,
73): string {
74 if (isDeno) {
75 return Deno.readTextFileSync(path);
76 } else {
77 try {
78 return getNodeFs().readFileSync(path, "utf-8");
79 } catch (error) {
80 throw mapError(error);
81 }
82 }
83}

Calls 2

getNodeFsFunction · 0.90
mapErrorFunction · 0.90

Tested by

no test coverage detected