Package version: 1.1.0 (from package.json). License: MIT. Engines: Node.js >=18. The repository’s unit-test runner in CI is Bun 1.4.0; that is not a consumer engine constraint.
npm i logbunyarn add logbunpnpm add logbunbun add logbunDeno imports the npm artifact (npm:logbun). Grant filesystem permissions when using filesystem durability — see Deno.
Optional peers
Install only what you import. All of these are optional in package.json peerDependenciesMeta.
# TursoAdapter
npm i @libsql/client# TursoAdapter
yarn add @libsql/client# TursoAdapter
pnpm add @libsql/client# TursoAdapter
bun add @libsql/client# ClickHouseAdapter
npm i @clickhouse/client# ClickHouseAdapter
yarn add @clickhouse/client# ClickHouseAdapter
pnpm add @clickhouse/client# ClickHouseAdapter
bun add @clickhouse/client# logbun/plugins/elysia
npm i elysia# logbun/plugins/elysia
yarn add elysia# logbun/plugins/elysia
pnpm add elysia# logbun/plugins/elysia
bun add elysia# logbun/plugins/hono
npm i hono# logbun/plugins/hono
yarn add hono# logbun/plugins/hono
pnpm add hono# logbun/plugins/hono
bun add honoBunSQLiteAdapter has no npm peer; it imports bun:sqlite and only runs on Bun.
Peer ranges declared by the package:
| Peer | Range |
|---|---|
@libsql/client |
>=0.6.0 |
@clickhouse/client |
>=1.0.0 |
elysia |
>=1.0.0 |
hono |
>=4.0.0 |
Package exports
logbun
logbun/durability/filesystem # Node / Bun / Deno (node:fs)
logbun/durability/cloudflare # Workers Durable Object SQLite (ESM-only; no CJS)
logbun/adapters/bun-sqlite
logbun/adapters/turso
logbun/adapters/clickhouse
logbun/adapters/cloudflare-analytics-engine
logbun/plugins/elysia
logbun/plugins/honoThe root graph is ES2022 / Web APIs: no node:, bun:, or process. Runtime-specific storage is reached only through the durability and adapter subpaths.
logbun/durability/cloudflare has an import condition only. There is no require / CJS export.
Runtime matrix
| Volatile (root default) | File reliability | CF DO reliability | |
|---|---|---|---|
| Runtimes | Node, Bun, Deno, Workers | Node, Bun, Deno | Workers Durable Object |
| Journal | no (optional in-process memory) | WAL segments | DO SQLite |
| DLQ | memory | files + opaque IDs | DO SQLite |
| Survive process death | no | yes | yes |
| Host maintenance | yes (DLQ / retry / retention) | yes | DO alarm |
Type-safe actions
type Actions = 'user.created' | 'user.updated';
const audit = new AuditLogger<Actions>({
namespace: 'my-app',
adapter,
});
audit.fire('user.created', { actorId: 'u1' });
// @ts-expect-error — not in Actions
audit.fire('user.deleted', { actorId: 'u1' });