Run TypeScript on the Go. Power TypeScript with Go voltage.
Golt bundles your TypeScript entry file with esbuild and executes it in a Go-based JS engine, with a small, explicit runtime API.
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);
High voltage, low surface area.
Built for developers who want TypeScript ergonomics with Go deployment discipline: predictable runtime APIs and a clean CLI.
Write TS. Bundle and run it without juggling Node tooling at runtime.
esbuild compiles and bundles your entry file into a single executable script.
Keep runtime globals explicit and stable as your project grows.
Golt.App() gives you routing,
middleware, and a net/http server, with Go-style path params like
/users/{id}.
Runs in a Node-like event loop model (via goja_nodejs).
golt init creates TS config and
typings for you.
Compilation and runtime errors are surfaced clearly to stdout.
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.
Your entry file becomes a single runnable JS bundle.
Run inside a Go engine with an event loop model.
Expose carefully chosen APIs as your platform evolves.
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.envAccess 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).
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);
Golt.logger(config?)Create a logging middleware for app.use.
"dev" (default) or "tiny".
const app = Golt.App();
app.use(Golt.logger({ format: "tiny" }));
app.get("/", (c) => c.Send("ok"));
app.serve(3000);
From zero to running in minutes.
golt init scaffolds a minimal TypeScript project (including typings), and
golt run executes your entry file.
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;
}
Build from source (Windows example):
go build -o golt.exe .\cmd\golt
go install .\cmd\golt
Initialize and execute your first script:
golt init
golt run .\app.ts
golt init creates golt.d.ts, tsconfig.json, and app.ts.
Jump to the repository README and contribution guidelines.
Ship scripts with volt-level clarity.
If you want TypeScript ergonomics but prefer a Go-shaped runtime surface, Golt is a sharp starting point.