MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / readFile

Function readFile

src/back/ConfigFile.ts:7–13  ·  view source on GitHub ↗
(filePath: string, onError?: (error: string) => void)

Source from the content-addressed store, hash-verified

5
6export namespace ConfigFile {
7 export function readFile(filePath: string, onError?: (error: string) => void): Promise<AppConfigData> {
8 return new Promise((resolve, reject) => {
9 readJsonFile(filePath, 'utf8')
10 .then(json => resolve(parse(json, onError)))
11 .catch(reject);
12 });
13 }
14
15 export function readFileSync(filePath: string, onError?: (error: string) => void): AppConfigData {
16 return parse(readJsonFileSync(filePath), onError);

Callers 1

readOrCreateFileFunction · 0.70

Calls 2

readJsonFileFunction · 0.90
parseFunction · 0.70

Tested by

no test coverage detected