Getting Started
Kyushu is an open source CLI for running JavaScript and TypeScript workers in a WebAssembly sandbox. This guide walks you through getting your first worker up and running.
Install
Section titled “Install”Open a terminal window and install the command line tool kyu.
curl -fsSL https://kyushu.dev/install | bashOr download a pre-built binary from the releases page.
Quick start
Section titled “Quick start”The following steps take you from a blank TypeScript file to a running HTTP handler.
-
Write a worker
Create
src/index.tswith a simple fetch handler:import type { ExportedHandler } from "kyushu-types";export default {async fetch(request) {return {status: 200,headers: { "content-type": "application/json" },body: JSON.stringify({ hello: "world" }),};},} satisfies ExportedHandler; -
Build the worker
Run this on your development machine. It bundles your code and produces a self-contained
.wasmfile.Terminal window kyu buildYou should see
worker/__kyushu_worker.wasmappear. -
Run the worker
Run this wherever you want to serve requests.
Terminal window kyu run# Listening on http://0.0.0.0:5987Test it:
Terminal window curl http://localhost:5987# {"hello":"world"}
TypeScript types
Section titled “TypeScript types”For autocompletion, install the kyushu-types library. See the TypeScript reference for the full API.