MCPcopy
hub / github.com/typicode/lowdb / read

Method read

src/adapters/node/TextFile.ts:18–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 }
17
18 async read(): Promise<string | null> {
19 let data
20
21 try {
22 data = await readFile(this.#filename, 'utf-8')
23 } catch (e) {
24 if ((e as NodeJS.ErrnoException).code === 'ENOENT') {
25 return null
26 }
27 throw e
28 }
29
30 return data
31 }
32
33 write(str: string): Promise<void> {
34 return this.#writer.write(str)

Callers 2

JSONFile.test.tsFile · 0.45
TextFile.test.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected