tomasi.studio

boomkat runtime

A small JavaScript runtime on the boomkat engine, uWebSockets and OpenSSL, with fine-grained permission control.

read the docs open in github (opens in a new tab)

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

req/sbkrbunnode
hello262,286219,579123,270
JSON226,768201,530121,041
async185,002181,451143,194
echo 1 KB174,470167,45695,804
stream 8 KB93,613109,45485,327
file 4 KB91,15547,98455,548

wrk -t2 -c128 on one machine, median of three runs. Each server runs the same workloads with its own HTTP API.

memory

MBbkrbunnode
hello11.9 MB45.2 MB108.6 MB
JSON11.9 MB44.8 MB108.6 MB
async12.4 MB56.7 MB195.3 MB
echo 1 KB13.3 MB50.7 MB118.9 MB
stream 8 KB12.0 MB78.1 MB108.1 MB
file 4 KB13.0 MB39.3 MB208.8 MB

Peak server RSS, sampled every 100 ms during the wrk runs. Lower is better.