MCPcopy Create free account
hub / github.com/alangpierce/sucrase / readFileContents

Function readFileContents

script/util/readFileContents.ts:3–5  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

1import {readFile} from "fs/promises";
2
3export async function readFileContents(path: string): Promise<string> {
4 return (await readFile(path)).toString();
5}
6// eslint-disable-next-line @typescript-eslint/no-explicit-any
7export async function readJSONFileContents(path: string): Promise<any> {
8 return JSON.parse(await readFileContents(path));

Callers 4

getTestCodeFunction · 0.90
readJSONFileContentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…