Get Started

Install

React

npm install @wterm/dom @wterm/react

Vanilla JS

npm install @wterm/dom

The WASM binary is embedded in the package — no extra setup required.

Quick Start

React

import { Terminal } from "@wterm/react";
import "@wterm/react/css";

function App() {
  return <Terminal />;
}

Vanilla JS

import { WTerm } from "@wterm/dom";
import "@wterm/dom/css";

const term = new WTerm(document.getElementById("terminal"));
await term.init();

Serving WASM separately

By default the ~12 KB WASM binary is loaded from the JS bundle. To serve it as a separate static file instead (for caching or CDN), copy it from the package and pass wasmUrl:

cp node_modules/@wterm/core/wasm/wterm.wasm public/wterm.wasm
<Terminal wasmUrl="/wterm.wasm" />

Building the WASM Binary

Requires Zig 0.16.0

zig build -Doptimize=ReleaseSmall

The compiled binary is output to web/wterm.wasm.