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

Function readOne

apps/desktop/src/main/tasks.ts:12–28  ·  view source on GitHub ↗
(
  root: string,
  meta: NoteMeta
)

Source from the content-addressed store, hash-verified

10}
11
12async function readOne(
13 root: string,
14 meta: NoteMeta
15): Promise<VaultTask[]> {
16 const abs = path.join(root, meta.path.split('/').join(path.sep))
17 let body: string
18 try {
19 body = await fs.readFile(abs, 'utf8')
20 } catch {
21 return []
22 }
23 return parseTasksFromBody(body, {
24 path: meta.path,
25 title: meta.title,
26 folder: meta.folder
27 })
28}
29
30/** Walk the whole vault and parse every task out of every live (non-trash)
31 * note. Parallelized with `Promise.all` so a 500-note vault is IO-bound,

Callers 1

scanAllTasksFunction · 0.85

Calls 1

parseTasksFromBodyFunction · 0.90

Tested by

no test coverage detected