Skip to content

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.

Open a terminal window and install the command line tool kyu.

Terminal window
curl -fsSL https://kyushu.dev/install | bash

Or download a pre-built binary from the releases page.

The following steps take you from a blank TypeScript file to a running HTTP handler.

  1. Write a worker

    Create src/index.ts with 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;
  2. Build the worker

    Run this on your development machine. It bundles your code and produces a self-contained .wasm file.

    Terminal window
    kyu build

    You should see worker/__kyushu_worker.wasm appear.

  3. Run the worker

    Run this wherever you want to serve requests.

    Terminal window
    kyu run
    # Listening on http://0.0.0.0:5987

    Test it:

    Terminal window
    curl http://localhost:5987
    # {"hello":"world"}

For autocompletion, install the kyushu-types library. See the TypeScript reference for the full API.