Skip to content
Golt Go + Volt runtime for TypeScript
Get started
Go + Volt A Go-native way to run TypeScript

Run TypeScript on the Go.

Golt bundles your TypeScript entry file with esbuild and executes it in a Go-based JS engine, with a small, explicit runtime API.

Workflow
init → run
Scaffold TS, execute instantly
Runtime
Go-based JS
Small native surface area
Built-ins
console + env + App + logger
Runtime primitives + HTTP app framework
Try it
Quickstart
golt init
golt run app.ts

// app.ts
const app = Golt.App();

app.use(Golt.logger({ format: "tiny" }));

app.get("/", (c) => {
  c.Send("Hello from Golt HTTP");
});

app.get("/users/{id}", (c) => {
  c.Json({ id: c.Param("id") });
});

app.notFound((c) => {
  c.Status(404).Send("not found");
});

app.serve(3000);
Bundled execution
esbuild → single bundle
TypeScript in, optimized JS out
Extensible
Native modules
Grow the API surface deliberately
Features

High voltage, low surface area.

Built for developers who want TypeScript ergonomics with Go deployment discipline: predictable runtime APIs and a clean CLI.

Jump to quickstart
TypeScript-first

Write TS. Bundle and run it without juggling Node tooling at runtime.

Bundled execution

esbuild compiles and bundles your entry file into a single executable script.

Small API surface

Keep runtime globals explicit and stable as your project grows.

HTTP server

Golt.App() gives you routing, middleware, and a net/http server, with Go-style path params like /users/{id}.

Event loop friendly

Runs in a Node-like event loop model (via goja_nodejs).

Easy scaffolding

golt init creates TS config and typings for you.

Developer friendly errors

Compilation and runtime errors are surfaced clearly to stdout.

How it works

A clean circuit: compile → run → extend.

Golt is intentionally simple: it builds a bundle from your entry file, spins up a Go-hosted runtime, then registers native modules (like console, Golt.env, Golt.logger, and Golt.App) before executing your program.

01 Bundle
esbuild compiles TS

Your entry file becomes a single runnable JS bundle.

02 Execute
Go-hosted JS runtime

Run inside a Go engine with an event loop model.

03 Extend
Register native modules

Expose carefully chosen APIs as your platform evolves.

API

Small, explicit runtime primitives.

Today, Golt ships four primitives: console.log, Golt.env, Golt.App, and Golt.logger.

console.log(...args)

Print exported JS values to stdout.

console.log("Hello from Golt");
console.log({ ok: true, now: Date.now() });
Golt.env

Access host environment variables: Record<string, string | undefined>.

console.log("PATH =", Golt.env["PATH"]);
console.log("NODE_ENV =", Golt.env["NODE_ENV"]);
Golt.App()

Create an HTTP app: routes, middleware, notFound, and app.serve(port).

Routes are registered on a per-app ServeMux using Go 1.22+ patterns (e.g. /users/{id}). Access params with c.Param("id"). Middleware runs in a simple next() chain before the route handler.
const app = Golt.App();

app.get("/", (c) => c.Send("hello"));

app.get("/users/{id}", (c) => {
  c.Json({ id: c.Param("id") });
});

app.notFound((c) => c.Status(404).Send("not found"));

app.serve(3000);
Context: Method(), Url(), Param(), Status(), Send(), Json(), ValidateBody()
Golt.logger(config?)

Create a logging middleware for app.use.

Formats: "dev" (default) or "tiny".
const app = Golt.App();

app.use(Golt.logger({ format: "tiny" }));

app.get("/", (c) => c.Send("ok"));

app.serve(3000);
Quickstart

From zero to running in minutes.

golt init scaffolds a minimal TypeScript project (including typings), and golt run executes your entry file.

TypeScript typings

golt init generates golt.d.ts with typings for Golt.App, Golt.logger, and the HTTP Context API (including schema inference for ValidateBody).

declare namespace Golt {
  export type SchemaType = "string" | "number" | "boolean";
  export type Next = () => void;
  export type Middleware = (c: Context, next: Next) => void;

  export interface Context {
    Method(): string;
    Url(): string;
    Param(name: string): string;
    Status(code: number): Context;
    Send(body: string): void;
    Json(data: any): void;
    ValidateBody<T extends Record<string, SchemaType>>(schema: T): InferSchema<T> | null;
  }

  export interface AppInstance {
    use(middleware: Middleware): AppInstance;
    get(path: string, handler: (c: Context) => void): AppInstance;
    post(path: string, handler: (c: Context) => void): AppInstance;
    notFound(handler: (c: Context) => void): AppInstance;
    serve(port: number): void;
  }

  export function App(): AppInstance;
  export function logger(config?: { format?: "dev" | "tiny" }): Middleware;
}
Install

Build from source (Windows example):

go build -o golt.exe .\cmd\golt
Or install with: go install .\cmd\golt
Run

Initialize and execute your first script:

golt init
golt run .\app.ts
Tip: golt init creates golt.d.ts, tsconfig.json, and app.ts.
Read more

Jump to the repository README and contribution guidelines.

Call to action

Ship scripts with volt-level clarity.

If you want TypeScript ergonomics but prefer a Go-shaped runtime surface, Golt is a sharp starting point.

Yellow: signal Blue: flow Black: discipline