Skip to content

Installation

Package version, supported runtimes, optional peers, and subpath exports.

Updated View as Markdown

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 logbun

Deno 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
# ClickHouseAdapter
npm i @clickhouse/client
# logbun/plugins/elysia
npm i elysia
# logbun/plugins/hono
npm i hono

BunSQLiteAdapter 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/hono

The 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' });
Navigation

Type to search…

↑↓ navigate↵ selectEsc close