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

Function readMeta

apps/desktop/src/mcp/vault-ops.ts:424–443  ·  view source on GitHub ↗
(root: string, abs: string, folder: NoteFolder)

Source from the content-addressed store, hash-verified

422}
423
424async function readMeta(root: string, abs: string, folder: NoteFolder): Promise<NoteMeta> {
425 const stat = await fs.stat(abs)
426 let body = ''
427 try {
428 body = await fs.readFile(abs, 'utf8')
429 } catch {
430 /* treat as empty */
431 }
432 return {
433 path: toPosix(path.relative(root, abs)),
434 title: path.basename(abs, path.extname(abs)),
435 folder,
436 createdAt: stat.birthtimeMs || stat.ctimeMs,
437 updatedAt: stat.mtimeMs,
438 size: stat.size,
439 tags: extractTags(body),
440 wikilinks: extractWikilinks(body),
441 excerpt: buildExcerpt(body)
442 }
443}
444
445/* ---------- Listing --------------------------------------------------- */
446

Callers 12

walkFunction · 0.70
readNoteFunction · 0.70
writeNoteFunction · 0.70
createNoteFunction · 0.70
renameNoteFunction · 0.70
moveBetweenFoldersFunction · 0.70
moveNoteFunction · 0.70
duplicateNoteFunction · 0.70
appendToNoteFunction · 0.70
prependToNoteFunction · 0.70
replaceInNoteFunction · 0.70
insertAtLineFunction · 0.70

Calls 4

toPosixFunction · 0.70
extractTagsFunction · 0.70
extractWikilinksFunction · 0.70
buildExcerptFunction · 0.70

Tested by

no test coverage detected