MCPcopy Create free account
hub / github.com/bitpay/bitcore / load

Method load

packages/bitcore-cli/src/filestorage.ts:25–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 }
24
25 async load() {
26 try {
27 let data = await fs.promises.readFile(this.filename, 'utf8');
28 data = Utils.jsonParseWithBuffer(data);
29 return data as any; // TODO provide a proper type
30 } catch {
31 Utils.die('Invalid input file');
32 }
33 }
34
35 exists() {
36 return fs.existsSync(this.filename);

Callers

nothing calls this directly

Calls 2

jsonParseWithBufferMethod · 0.80
dieMethod · 0.80

Tested by

no test coverage detected