tomasi.studio

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/sbkrnodebun
hello262,286123,270219,579
JSON226,768121,041201,530
async immediate185,002143,194181,451
async timer117,86975,852114,169
echo 1 KB174,47095,804167,456
stream 8 KB93,61385,327109,454
file 4 KB91,15555,54847,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