# Runtimes

The same components, native runtime and app API run on four runtimes. Each keeps its own strengths and limits: there is no promise of feature parity between them.

## Which runtime

| Runtime | Windows / Linux | Android | What it gives you |
| --- | --- | --- | --- |
| Bun 1.4+ | `run`, `dev`, `build` | `build --target android --runtime bun` | The fastest dev loop, `bun:ffi`, `bun:sqlite`, single-file executables. |
| Node.js 26.10+ | `run`, `dev`, `build` | Builds the APK; the app runs on QuickJS-ng or Bun | The npm ecosystem and Node single-executable apps. FFI and SEA are experimental in Node 26. |
| txiki.js / QuickJS-ng | `build --runtime txiki` | The default engine on the device | Executables and APKs of a few MB, with a subset of Node APIs through shims. |
| Go | `go run`, `go build` | `tarve build <go package> --target android` | No JavaScript at all. |

`tarve` uses the runtime that launched it: `bunx` and `bun run` pick Bun, `npx` and `npm run` pick Node.js. `--runtime bun|node|txiki` overrides it.

## Node.js

A Node-only project needs neither Bun nor Rust. `dev` rebuilds the TSX with esbuild and remounts into the same window when the entry uses `await render(App)`. Builds embed the app and the native library in a Node.js single-executable application; the first build for a target downloads the matching official Node.js binary, checks it against `SHASUMS256.txt` and caches it (`TARVE_CACHE_DIR`). Offline, pass one with `--target-executable`.

```sh
npm install @tarve/core
npx tarve dev app.tsx
npx tarve build app.tsx --target linux-x64 --outfile dist/App
```

From code, `build({ entrypoint: "app.tsx", runtime: "node" })` from `@tarve/core/build`, or `buildNode` from `@tarve/core/build-node`.

## txiki.js

txiki.js has no `tarve run` or `dev`: develop on Bun or Node.js and build with `--runtime txiki`. The shims cover `fs`, `path`, `os`, `crypto` hashes, `fetch` and synchronous `zlib`/gzip; on the desktop also `child_process` `spawn`/`spawnSync`, `net` pipes and plugin FFI through `tjs:ffi`. Known limits: `server.unref()` throws, a `fetch` cannot be aborted while its TCP connection opens, and auto-updates do not support txiki.js builds yet.

## Go

The Go module in `go/` drives the same native runtime without JavaScript, with the same `App` methods (`app.Notify`, `app.RequestPermissions`, …). See `go/README.md` in the repository.

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/runtimes · Index for agents: https://tarve.dev/llms.txt
