boomkat runtime
A small JavaScript runtime on the boomkat engine, uWebSockets and OpenSSL, with fine-grained permission control.
try it now
$ curl https://boomkat.run/install | sh
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
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
benchmarks
hello
JSON
async
echo 1 KB
stream 8 KB
file 4 KB
| req/s | bkr | bun | node |
|---|---|---|---|
| hello | 262,286 | 219,579 | 123,270 |
| JSON | 226,768 | 201,530 | 121,041 |
| async | 185,002 | 181,451 | 143,194 |
| echo 1 KB | 174,470 | 167,456 | 95,804 |
| stream 8 KB | 93,613 | 109,454 | 85,327 |
| file 4 KB | 91,155 | 47,984 | 55,548 |
wrk -t2 -c128 on one machine, median of three runs. Each server runs the same workloads with its own HTTP API.
memory
hello
JSON
async
echo 1 KB
stream 8 KB
file 4 KB
| MB | bkr | bun | node |
|---|---|---|---|
| hello | 11.9 MB | 45.2 MB | 108.6 MB |
| JSON | 11.9 MB | 44.8 MB | 108.6 MB |
| async | 12.4 MB | 56.7 MB | 195.3 MB |
| echo 1 KB | 13.3 MB | 50.7 MB | 118.9 MB |
| stream 8 KB | 12.0 MB | 78.1 MB | 108.1 MB |
| file 4 KB | 13.0 MB | 39.3 MB | 208.8 MB |
Peak server RSS, sampled every 100 ms during the wrk runs. Lower is better.