boomkat runtime
A small JavaScript runtime on the boomkat engine, uWebSockets and OpenSSL, with fine-grained permission control.
features
- permissions
- --allow-net, --allow-read and --allow-write, scoped to hosts or paths
- http
- standards-based server with routes, TLS and WebSockets
- TSX serving
- transpiles TSX to browser JavaScript, with source maps
- sqlite
- optional built-in with prepared statements and transactions
- workers
- module workers that inherit the parent's permissions
- packages
- plain ESM - clean break from npm
benchmarks
| req/s | bkr | node | bun |
|---|---|---|---|
| hello | 262,286 | 123,270 | 219,579 |
| JSON | 226,768 | 121,041 | 201,530 |
| async immediate | 185,002 | 143,194 | 181,451 |
| async timer | 117,869 | 75,852 | 114,169 |
| echo 1 KB | 174,470 | 95,804 | 167,456 |
| stream 8 KB | 93,613 | 85,327 | 109,454 |
| file 4 KB | 91,155 | 55,548 | 47,984 |
wrk -t2 -c128 on one machine, median of three runs. Each server runs the same workloads with its own HTTP API.
built-in modules
- http
- serve, upgradeWebSocket
- net
- TCP and TLS connect, listen, DNS resolve
- file
- read, write, open, stat, list, mkdir, copy
- process
- args, env, stdio, spawn, run
- path
- join, resolve, relative, file URLs
- crypto
- random bytes, sha256, password hashing, subtle
- typescript
- type erasure and JSX lowering with source maps
- test
- test, describe, hooks and assertions
example
// hello.js
import { serve } from "http";
serve({
port: 8080,
fetch(req) {
return new Response("hello");
},
});
$ bkr --allow-net hello.js