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

Function createFolder

apps/desktop/src/main/vault.ts:3358–3367  ·  view source on GitHub ↗
(
  root: string,
  topFolder: NoteFolder,
  subpath: string
)

Source from the content-addressed store, hash-verified

3356 * and it just works).
3357 */
3358export async function createFolder(
3359 root: string,
3360 topFolder: NoteFolder,
3361 subpath: string
3362): Promise<void> {
3363 const trimmed = subpath.replace(/^\/+|\/+$/g, '')
3364 if (!trimmed) throw new Error('Folder name is required')
3365 const abs = resolveSafe(await folderRoot(root, topFolder), trimmed)
3366 await fs.mkdir(abs, { recursive: true })
3367}
3368
3369/**
3370 * Rename or move a subfolder. `newSubpath` is the full target path

Callers 3

registerIpcFunction · 0.90
BreadcrumbFunction · 0.50
cmdFolderCreateFunction · 0.50

Calls 2

resolveSafeFunction · 0.70
folderRootFunction · 0.70

Tested by

no test coverage detected