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

Function writeNote

apps/desktop/src/mcp/vault-ops.ts:569–576  ·  view source on GitHub ↗
(root: string, rel: string, body: string)

Source from the content-addressed store, hash-verified

567}
568
569export async function writeNote(root: string, rel: string, body: string): Promise<NoteMeta> {
570 const abs = resolveSafe(root, rel)
571 await fs.mkdir(path.dirname(abs), { recursive: true })
572 await fs.writeFile(abs, body, 'utf8')
573 const folder = folderOf(root, abs)
574 if (!folder) throw new Error(`Note not in a known folder: ${rel}`)
575 return await readMeta(root, abs, folder)
576}
577
578async function uniqueTitle(dir: string, base: string): Promise<string> {
579 let candidate = base

Callers 1

server.tsFile · 0.70

Calls 3

resolveSafeFunction · 0.70
folderOfFunction · 0.70
readMetaFunction · 0.70

Tested by

no test coverage detected