@delali/sirannon-db 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +14 -0
- package/README.md +418 -0
- package/dist/chunk-VI4UP4RR.mjs +417 -0
- package/dist/client/index.d.ts +223 -0
- package/dist/client/index.mjs +479 -0
- package/dist/core/index.d.ts +295 -0
- package/dist/core/index.mjs +1346 -0
- package/dist/protocol-BX1H-_Mz.d.ts +104 -0
- package/dist/server/index.d.ts +103 -0
- package/dist/server/index.mjs +808 -0
- package/dist/sirannon-BJ8Yd1Uf.d.ts +148 -0
- package/dist/types-DArCObcu.d.ts +186 -0
- package/package.json +87 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { Q as QueryHookContext, g as ConnectionHookContext, c as BeforeSubscribeHook, H as HookConfig, M as MetricsConfig, l as QueryMetrics, h as ConnectionMetrics, C as CDCMetrics, P as Params, E as ExecuteResult, D as DatabaseOptions, p as SubscriptionBuilder, B as BackupScheduleOptions, b as BeforeQueryHook, A as AfterQueryHook, n as SirannonOptions, a as BeforeConnectHook, k as DatabaseOpenHook, j as DatabaseCloseHook } from './types-DArCObcu.js';
|
|
2
|
+
import Database$1 from 'better-sqlite3';
|
|
3
|
+
|
|
4
|
+
type HookEvent = 'beforeQuery' | 'afterQuery' | 'beforeConnect' | 'databaseOpen' | 'databaseClose' | 'beforeSubscribe';
|
|
5
|
+
type SubscribeHookContext = Parameters<BeforeSubscribeHook>[0];
|
|
6
|
+
interface HookEventContextMap {
|
|
7
|
+
beforeQuery: QueryHookContext;
|
|
8
|
+
afterQuery: QueryHookContext & {
|
|
9
|
+
durationMs: number;
|
|
10
|
+
};
|
|
11
|
+
beforeConnect: ConnectionHookContext;
|
|
12
|
+
databaseOpen: ConnectionHookContext;
|
|
13
|
+
databaseClose: ConnectionHookContext;
|
|
14
|
+
beforeSubscribe: SubscribeHookContext;
|
|
15
|
+
}
|
|
16
|
+
type HookHandler<E extends HookEvent> = (ctx: HookEventContextMap[E]) => void | Promise<void>;
|
|
17
|
+
type HookDispose = () => void;
|
|
18
|
+
|
|
19
|
+
declare class HookRegistry {
|
|
20
|
+
private hooks;
|
|
21
|
+
constructor(config?: HookConfig);
|
|
22
|
+
register<E extends HookEvent>(event: E, hook: HookHandler<E>): HookDispose;
|
|
23
|
+
invoke<E extends HookEvent>(event: E, ctx: HookEventContextMap[E]): Promise<void>;
|
|
24
|
+
invokeSync<E extends HookEvent>(event: E, ctx: HookEventContextMap[E]): void;
|
|
25
|
+
has(event: HookEvent): boolean;
|
|
26
|
+
count(event: HookEvent): number;
|
|
27
|
+
clear(event?: HookEvent): void;
|
|
28
|
+
private addHook;
|
|
29
|
+
private loadConfig;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare class MetricsCollector {
|
|
33
|
+
private config;
|
|
34
|
+
constructor(config?: MetricsConfig);
|
|
35
|
+
trackQuery<T>(fn: () => T, context: Omit<QueryMetrics, 'durationMs' | 'error'>): T;
|
|
36
|
+
trackConnection(metrics: ConnectionMetrics): void;
|
|
37
|
+
trackCDCEvent(metrics: CDCMetrics): void;
|
|
38
|
+
get active(): boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type SqliteDb = InstanceType<typeof Database$1>;
|
|
42
|
+
declare class Transaction {
|
|
43
|
+
private readonly db;
|
|
44
|
+
private _lastInsertRowId;
|
|
45
|
+
constructor(db: SqliteDb);
|
|
46
|
+
query<T = Record<string, unknown>>(sql: string, params?: Params): T[];
|
|
47
|
+
execute(sql: string, params?: Params): ExecuteResult;
|
|
48
|
+
executeBatch(sql: string, paramsBatch: Params[]): ExecuteResult[];
|
|
49
|
+
get lastInsertRowId(): number | bigint;
|
|
50
|
+
static run<T>(db: SqliteDb, fn: (tx: Transaction) => T): T;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface AppliedMigration {
|
|
54
|
+
version: number;
|
|
55
|
+
name: string;
|
|
56
|
+
applied_at: number;
|
|
57
|
+
}
|
|
58
|
+
interface Migration {
|
|
59
|
+
version: number;
|
|
60
|
+
name: string;
|
|
61
|
+
up: string | ((tx: Transaction) => void);
|
|
62
|
+
down?: string | ((tx: Transaction) => void);
|
|
63
|
+
}
|
|
64
|
+
interface AppliedMigrationEntry {
|
|
65
|
+
version: number;
|
|
66
|
+
name: string;
|
|
67
|
+
}
|
|
68
|
+
interface MigrationResult {
|
|
69
|
+
applied: AppliedMigrationEntry[];
|
|
70
|
+
skipped: number;
|
|
71
|
+
}
|
|
72
|
+
interface RollbackResult {
|
|
73
|
+
rolledBack: AppliedMigrationEntry[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface DatabaseInternals {
|
|
77
|
+
parentHooks?: HookRegistry;
|
|
78
|
+
metrics?: MetricsCollector;
|
|
79
|
+
}
|
|
80
|
+
declare class Database {
|
|
81
|
+
readonly id: string;
|
|
82
|
+
readonly path: string;
|
|
83
|
+
readonly readOnly: boolean;
|
|
84
|
+
private readonly pool;
|
|
85
|
+
private readonly closeListeners;
|
|
86
|
+
private _closed;
|
|
87
|
+
private changeTracker;
|
|
88
|
+
private subscriptionManager;
|
|
89
|
+
private stopCdcPolling;
|
|
90
|
+
private readonly cdcPollInterval;
|
|
91
|
+
private readonly cdcRetention;
|
|
92
|
+
private readonly hookRegistry;
|
|
93
|
+
private readonly parentHooks;
|
|
94
|
+
private readonly metricsCollector;
|
|
95
|
+
private readonly backupManager;
|
|
96
|
+
private readonly backupScheduler;
|
|
97
|
+
private readonly scheduledBackupCancellers;
|
|
98
|
+
constructor(id: string, path: string, options?: DatabaseOptions, internals?: DatabaseInternals);
|
|
99
|
+
query<T = Record<string, unknown>>(sql: string, params?: Params): T[];
|
|
100
|
+
queryOne<T = Record<string, unknown>>(sql: string, params?: Params): T | undefined;
|
|
101
|
+
execute(sql: string, params?: Params): ExecuteResult;
|
|
102
|
+
executeBatch(sql: string, paramsBatch: Params[]): ExecuteResult[];
|
|
103
|
+
transaction<T>(fn: (tx: Transaction) => T): T;
|
|
104
|
+
watch(table: string): void;
|
|
105
|
+
unwatch(table: string): void;
|
|
106
|
+
on(table: string): SubscriptionBuilder;
|
|
107
|
+
migrate(input: string | Migration[]): MigrationResult;
|
|
108
|
+
rollback(input: string | Migration[], version?: number): RollbackResult;
|
|
109
|
+
backup(destPath: string): void;
|
|
110
|
+
scheduleBackup(options: BackupScheduleOptions): void;
|
|
111
|
+
loadExtension(extensionPath: string): void;
|
|
112
|
+
onBeforeQuery(hook: BeforeQueryHook): void;
|
|
113
|
+
onAfterQuery(hook: AfterQueryHook): void;
|
|
114
|
+
addCloseListener(fn: () => void): void;
|
|
115
|
+
close(): void;
|
|
116
|
+
get closed(): boolean;
|
|
117
|
+
get readerCount(): number;
|
|
118
|
+
private ensureOpen;
|
|
119
|
+
private ensureCdc;
|
|
120
|
+
private ensureCdcPolling;
|
|
121
|
+
private stopCdcPollingLoop;
|
|
122
|
+
private fireBeforeQueryHooks;
|
|
123
|
+
private fireAfterQueryHooks;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare class Sirannon {
|
|
127
|
+
readonly options?: SirannonOptions | undefined;
|
|
128
|
+
private readonly dbs;
|
|
129
|
+
private _shutdown;
|
|
130
|
+
private readonly hookRegistry;
|
|
131
|
+
private readonly metricsCollector;
|
|
132
|
+
private readonly lifecycleManager;
|
|
133
|
+
constructor(options?: SirannonOptions | undefined);
|
|
134
|
+
open(id: string, path: string, options?: DatabaseOptions): Database;
|
|
135
|
+
close(id: string): void;
|
|
136
|
+
get(id: string): Database | undefined;
|
|
137
|
+
has(id: string): boolean;
|
|
138
|
+
databases(): Map<string, Database>;
|
|
139
|
+
shutdown(): void;
|
|
140
|
+
onBeforeQuery(hook: BeforeQueryHook): void;
|
|
141
|
+
onAfterQuery(hook: AfterQueryHook): void;
|
|
142
|
+
onBeforeConnect(hook: BeforeConnectHook): void;
|
|
143
|
+
onDatabaseOpen(hook: DatabaseOpenHook): void;
|
|
144
|
+
onDatabaseClose(hook: DatabaseCloseHook): void;
|
|
145
|
+
private ensureRunning;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export { type AppliedMigration as A, Database as D, type HookDispose as H, type Migration as M, type RollbackResult as R, Sirannon as S, Transaction as T, type MigrationResult as a, type AppliedMigrationEntry as b, type HookEvent as c, type HookEventContextMap as d, type HookHandler as e, HookRegistry as f, MetricsCollector as g, type SubscribeHookContext as h };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/** Query parameter types: named (object) or positional (array). */
|
|
2
|
+
type Params = Record<string, unknown> | unknown[];
|
|
3
|
+
/** Result returned by mutation statements (INSERT, UPDATE, DELETE). */
|
|
4
|
+
interface ExecuteResult {
|
|
5
|
+
changes: number;
|
|
6
|
+
lastInsertRowId: number | bigint;
|
|
7
|
+
}
|
|
8
|
+
/** CDC operation type. */
|
|
9
|
+
type ChangeOperation = 'insert' | 'update' | 'delete';
|
|
10
|
+
/** Event emitted when a watched table row changes. */
|
|
11
|
+
interface ChangeEvent<T = Record<string, unknown>> {
|
|
12
|
+
type: ChangeOperation;
|
|
13
|
+
table: string;
|
|
14
|
+
row: T;
|
|
15
|
+
oldRow?: T;
|
|
16
|
+
seq: bigint;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
}
|
|
19
|
+
/** Context passed to query hooks. */
|
|
20
|
+
interface QueryHookContext {
|
|
21
|
+
databaseId: string;
|
|
22
|
+
sql: string;
|
|
23
|
+
params?: Params;
|
|
24
|
+
metadata?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
/** Hook invoked before a query is executed. Throw to deny. */
|
|
27
|
+
type BeforeQueryHook = (ctx: QueryHookContext) => void | Promise<void>;
|
|
28
|
+
/** Hook invoked after a query is executed. */
|
|
29
|
+
type AfterQueryHook = (ctx: QueryHookContext & {
|
|
30
|
+
durationMs: number;
|
|
31
|
+
}) => void | Promise<void>;
|
|
32
|
+
/** Context passed to connection hooks. */
|
|
33
|
+
interface ConnectionHookContext {
|
|
34
|
+
databaseId: string;
|
|
35
|
+
path: string;
|
|
36
|
+
}
|
|
37
|
+
/** Hook invoked before a database connection is established. */
|
|
38
|
+
type BeforeConnectHook = (ctx: ConnectionHookContext) => void | Promise<void>;
|
|
39
|
+
/** Hook invoked when a database is opened. */
|
|
40
|
+
type DatabaseOpenHook = (ctx: ConnectionHookContext) => void | Promise<void>;
|
|
41
|
+
/** Hook invoked when a database is closed. */
|
|
42
|
+
type DatabaseCloseHook = (ctx: ConnectionHookContext) => void | Promise<void>;
|
|
43
|
+
/** Hook invoked before a subscription is created. Throw to deny. */
|
|
44
|
+
type BeforeSubscribeHook = (ctx: {
|
|
45
|
+
databaseId: string;
|
|
46
|
+
table: string;
|
|
47
|
+
filter?: Record<string, unknown>;
|
|
48
|
+
}) => void | Promise<void>;
|
|
49
|
+
/** Aggregated hook configuration. */
|
|
50
|
+
interface HookConfig {
|
|
51
|
+
onBeforeQuery?: BeforeQueryHook | BeforeQueryHook[];
|
|
52
|
+
onAfterQuery?: AfterQueryHook | AfterQueryHook[];
|
|
53
|
+
onBeforeConnect?: BeforeConnectHook | BeforeConnectHook[];
|
|
54
|
+
onDatabaseOpen?: DatabaseOpenHook | DatabaseOpenHook[];
|
|
55
|
+
onDatabaseClose?: DatabaseCloseHook | DatabaseCloseHook[];
|
|
56
|
+
onBeforeSubscribe?: BeforeSubscribeHook | BeforeSubscribeHook[];
|
|
57
|
+
}
|
|
58
|
+
/** Metrics emitted after a query completes. */
|
|
59
|
+
interface QueryMetrics {
|
|
60
|
+
databaseId: string;
|
|
61
|
+
sql: string;
|
|
62
|
+
durationMs: number;
|
|
63
|
+
rowsReturned?: number;
|
|
64
|
+
changes?: number;
|
|
65
|
+
error?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** Metrics emitted when a connection opens or closes. */
|
|
68
|
+
interface ConnectionMetrics {
|
|
69
|
+
databaseId: string;
|
|
70
|
+
path: string;
|
|
71
|
+
readerCount: number;
|
|
72
|
+
event: 'open' | 'close';
|
|
73
|
+
}
|
|
74
|
+
/** Metrics emitted when a CDC event is dispatched. */
|
|
75
|
+
interface CDCMetrics {
|
|
76
|
+
databaseId: string;
|
|
77
|
+
table: string;
|
|
78
|
+
operation: ChangeOperation;
|
|
79
|
+
subscriberCount: number;
|
|
80
|
+
}
|
|
81
|
+
/** Callbacks for metrics collection. */
|
|
82
|
+
interface MetricsConfig {
|
|
83
|
+
onQueryComplete?: (metrics: QueryMetrics) => void;
|
|
84
|
+
onConnectionOpen?: (metrics: ConnectionMetrics) => void;
|
|
85
|
+
onConnectionClose?: (metrics: ConnectionMetrics) => void;
|
|
86
|
+
onCDCEvent?: (metrics: CDCMetrics) => void;
|
|
87
|
+
}
|
|
88
|
+
/** Configuration for automatic database lifecycle management. */
|
|
89
|
+
interface LifecycleConfig {
|
|
90
|
+
autoOpen?: {
|
|
91
|
+
resolver: (id: string) => {
|
|
92
|
+
path: string;
|
|
93
|
+
options?: DatabaseOptions;
|
|
94
|
+
} | undefined;
|
|
95
|
+
};
|
|
96
|
+
/** Milliseconds before an idle database is closed. 0 = disabled. */
|
|
97
|
+
idleTimeout?: number;
|
|
98
|
+
/** Maximum number of concurrently open databases. 0 = unlimited. */
|
|
99
|
+
maxOpen?: number;
|
|
100
|
+
}
|
|
101
|
+
/** Options for opening a single database. */
|
|
102
|
+
interface DatabaseOptions {
|
|
103
|
+
/** Open the database in read-only mode. */
|
|
104
|
+
readOnly?: boolean;
|
|
105
|
+
/** Number of read connections in the pool. Default: 4. */
|
|
106
|
+
readPoolSize?: number;
|
|
107
|
+
/** Enable WAL mode. Default: true. */
|
|
108
|
+
walMode?: boolean;
|
|
109
|
+
/** CDC polling interval in milliseconds. Default: 50. */
|
|
110
|
+
cdcPollInterval?: number;
|
|
111
|
+
/** CDC retention period in milliseconds. Default: 3_600_000 (1 hour). */
|
|
112
|
+
cdcRetention?: number;
|
|
113
|
+
}
|
|
114
|
+
/** Top-level options for the Sirannon database registry. */
|
|
115
|
+
interface SirannonOptions {
|
|
116
|
+
hooks?: HookConfig;
|
|
117
|
+
metrics?: MetricsConfig;
|
|
118
|
+
lifecycle?: LifecycleConfig;
|
|
119
|
+
}
|
|
120
|
+
/** Options for scheduled backups. */
|
|
121
|
+
interface BackupScheduleOptions {
|
|
122
|
+
/** Cron expression (e.g., '0 * * * *' for hourly). */
|
|
123
|
+
cron: string;
|
|
124
|
+
/** Directory to store backup files. */
|
|
125
|
+
destDir: string;
|
|
126
|
+
/** Maximum number of backup files to keep. Default: 5. */
|
|
127
|
+
maxFiles?: number;
|
|
128
|
+
/** Called when a scheduled backup fails. Without this, errors are silently discarded. */
|
|
129
|
+
onError?: (error: Error) => void;
|
|
130
|
+
}
|
|
131
|
+
/** Builder for creating CDC subscriptions with optional filters. */
|
|
132
|
+
interface SubscriptionBuilder {
|
|
133
|
+
filter(conditions: Record<string, unknown>): SubscriptionBuilder;
|
|
134
|
+
subscribe(callback: (event: ChangeEvent) => void): Subscription;
|
|
135
|
+
}
|
|
136
|
+
/** Handle for an active subscription. */
|
|
137
|
+
interface Subscription {
|
|
138
|
+
unsubscribe(): void;
|
|
139
|
+
}
|
|
140
|
+
/** Context passed to the onRequest middleware hook. */
|
|
141
|
+
interface RequestContext {
|
|
142
|
+
headers: Record<string, string>;
|
|
143
|
+
method: string;
|
|
144
|
+
path: string;
|
|
145
|
+
databaseId?: string;
|
|
146
|
+
remoteAddress: string;
|
|
147
|
+
}
|
|
148
|
+
/** Return this from an onRequest hook to deny the request with a custom response. */
|
|
149
|
+
interface RequestDenial {
|
|
150
|
+
status: number;
|
|
151
|
+
code: string;
|
|
152
|
+
message: string;
|
|
153
|
+
}
|
|
154
|
+
/** Middleware hook for auth, rate limiting, and request validation. */
|
|
155
|
+
type OnRequestHook = (ctx: RequestContext) => undefined | RequestDenial | Promise<undefined | RequestDenial>;
|
|
156
|
+
/** Options for the standalone HTTP + WS server. */
|
|
157
|
+
interface ServerOptions {
|
|
158
|
+
host?: string;
|
|
159
|
+
port?: number;
|
|
160
|
+
cors?: boolean | CorsOptions;
|
|
161
|
+
onRequest?: OnRequestHook;
|
|
162
|
+
}
|
|
163
|
+
/** CORS configuration. */
|
|
164
|
+
interface CorsOptions {
|
|
165
|
+
origin?: string | string[];
|
|
166
|
+
methods?: string[];
|
|
167
|
+
headers?: string[];
|
|
168
|
+
}
|
|
169
|
+
/** Options for the mountable WebSocket handler. */
|
|
170
|
+
interface WSHandlerOptions {
|
|
171
|
+
/** Maximum message size in bytes. Default: 1_048_576 (1 MB). */
|
|
172
|
+
maxPayloadLength?: number;
|
|
173
|
+
}
|
|
174
|
+
/** Options for the client SDK. */
|
|
175
|
+
interface ClientOptions {
|
|
176
|
+
/** Transport to use. Default: 'websocket'. */
|
|
177
|
+
transport?: 'websocket' | 'http';
|
|
178
|
+
/** Custom headers for HTTP requests. */
|
|
179
|
+
headers?: Record<string, string>;
|
|
180
|
+
/** Reconnect on WebSocket disconnect. Default: true. */
|
|
181
|
+
autoReconnect?: boolean;
|
|
182
|
+
/** Reconnect interval in ms. Default: 1000. */
|
|
183
|
+
reconnectInterval?: number;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type { AfterQueryHook as A, BackupScheduleOptions as B, CDCMetrics as C, DatabaseOptions as D, ExecuteResult as E, HookConfig as H, LifecycleConfig as L, MetricsConfig as M, OnRequestHook as O, Params as P, QueryHookContext as Q, RequestContext as R, ServerOptions as S, WSHandlerOptions as W, BeforeConnectHook as a, BeforeQueryHook as b, BeforeSubscribeHook as c, ChangeEvent as d, ChangeOperation as e, ClientOptions as f, ConnectionHookContext as g, ConnectionMetrics as h, CorsOptions as i, DatabaseCloseHook as j, DatabaseOpenHook as k, QueryMetrics as l, RequestDenial as m, SirannonOptions as n, Subscription as o, SubscriptionBuilder as p };
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@delali/sirannon-db",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"description": "A production-grade library that turns SQLite databases into a networked data layer with real-time subscriptions.",
|
|
6
|
+
"author": "Delali (https://sondelali.com)",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"homepage": "https://github.com/assetcorp/sirannon-db",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/assetcorp/sirannon-db.git",
|
|
12
|
+
"directory": "packages/ts"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/assetcorp/sirannon-db/issues"
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"keywords": [
|
|
19
|
+
"sqlite",
|
|
20
|
+
"database",
|
|
21
|
+
"realtime",
|
|
22
|
+
"subscriptions",
|
|
23
|
+
"websocket",
|
|
24
|
+
"embedded",
|
|
25
|
+
"better-sqlite3"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"test:coverage": "vitest run --coverage",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"lint": "biome check .",
|
|
33
|
+
"lint:fix": "biome check --write .",
|
|
34
|
+
"format": "biome format --write .",
|
|
35
|
+
"bench": "node --expose-gc --import tsx benchmarks/run-all.ts",
|
|
36
|
+
"bench:micro": "node --expose-gc --import tsx benchmarks/micro/point-select.ts",
|
|
37
|
+
"bench:ycsb": "node --expose-gc --import tsx benchmarks/ycsb/workload-a.ts",
|
|
38
|
+
"bench:oltp": "node --expose-gc --import tsx benchmarks/oltp/tpc-c-lite.ts",
|
|
39
|
+
"bench:scaling": "node --expose-gc --import tsx benchmarks/scaling/concurrency.ts",
|
|
40
|
+
"bench:cdc": "node --expose-gc --import tsx benchmarks/sirannon/cdc-latency.ts",
|
|
41
|
+
"bench:docker": "node --import tsx benchmarks/run-docker.ts",
|
|
42
|
+
"bench:docker:e2e": "node --import tsx benchmarks/run-e2e.ts",
|
|
43
|
+
"bench:docker:engine": "node --expose-gc --import tsx benchmarks/run-engine.ts",
|
|
44
|
+
"bench:statistical": "node --expose-gc --import tsx benchmarks/run-statistical.ts",
|
|
45
|
+
"bench:charts": "python3 benchmarks/scripts/generate-charts.py benchmarks/results/"
|
|
46
|
+
},
|
|
47
|
+
"exports": {
|
|
48
|
+
".": {
|
|
49
|
+
"types": "./dist/core/index.d.ts",
|
|
50
|
+
"import": "./dist/core/index.mjs"
|
|
51
|
+
},
|
|
52
|
+
"./server": {
|
|
53
|
+
"types": "./dist/server/index.d.ts",
|
|
54
|
+
"import": "./dist/server/index.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./client": {
|
|
57
|
+
"types": "./dist/client/index.d.ts",
|
|
58
|
+
"import": "./dist/client/index.mjs"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"files": [
|
|
62
|
+
"dist",
|
|
63
|
+
"LICENSE",
|
|
64
|
+
"NOTICE"
|
|
65
|
+
],
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=22"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"better-sqlite3": "12.6.2",
|
|
71
|
+
"croner": "10.0.1",
|
|
72
|
+
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.58.0"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@types/better-sqlite3": "7.6.13",
|
|
76
|
+
"@types/node": "25.3.3",
|
|
77
|
+
"@types/pg": "8.11.10",
|
|
78
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
79
|
+
"pg": "8.19.0",
|
|
80
|
+
"simple-statistics": "7.8.7",
|
|
81
|
+
"tinybench": "6.0.0",
|
|
82
|
+
"tsup": "8.5.1",
|
|
83
|
+
"tsx": "4.21.0",
|
|
84
|
+
"typescript": "5.9.3",
|
|
85
|
+
"vitest": "4.0.18"
|
|
86
|
+
}
|
|
87
|
+
}
|