feat: add native KDBX scaffolding and in-memory KeePass API

This commit is contained in:
2026-05-10 01:17:53 +02:00
parent 210f7b414b
commit 15332896fe
25 changed files with 437 additions and 713 deletions
+4 -7
View File
@@ -1,13 +1,10 @@
import { readFile } from "node:fs/promises";
import { openKeePassDatabase } from "./keepass";
async function main() {
const { password } = JSON.parse(await readFile("tests/fixtures/data.kdbx.json", "utf8")) as { password: string };
const db = openKeePassDatabase("tests/fixtures/data.kdbx", { password });
const entries = await db.listEntries();
console.log(JSON.stringify({ ok: true, count: entries.length }, null, 2));
const db = openKeePassDatabase("memory.kdbx", { password: "demo" });
await db.createGroup({ name: "Folder1" });
await db.createEntry({ title: "Entry", username: "user", password: "secret" });
console.log(JSON.stringify({ ok: true, entries: await db.listEntries(), groups: await db.listGroups() }, null, 2));
}
main().catch((error) => {