MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / readNote

Function readNote

apps/desktop/src/main/vault.ts:2643–2650  ·  view source on GitHub ↗
(root: string, rel: string)

Source from the content-addressed store, hash-verified

2641}
2642
2643export async function readNote(root: string, rel: string): Promise<NoteContent> {
2644 const abs = resolveSafe(root, rel)
2645 const folder = folderOf(root, abs)
2646 if (!folder) throw new Error(`Note not in a known folder: ${rel}`)
2647 const body = await fs.readFile(abs, 'utf8')
2648 const meta = await readMeta(root, abs, folder)
2649 return { ...meta, body }
2650}
2651
2652export async function writeNote(root: string, rel: string, body: string): Promise<NoteMeta> {
2653 const abs = resolveSafe(root, rel)

Callers 5

registerIpcFunction · 0.90
vault.perf.test.tsFile · 0.90
updateInboundWikilinksFunction · 0.70
cmdReadFunction · 0.50

Calls 3

resolveSafeFunction · 0.70
folderOfFunction · 0.70
readMetaFunction · 0.70

Tested by

no test coverage detected