Golt TypeScript runtime powered by Go
Lightweight backend runtime

Write TypeScript. Run it on Go.

Golt bundles your TypeScript entry file with esbuild and executes it in a Go-hosted JavaScript engine. It gives backend scripts a small, explicit runtime API: HTTP, DB, filesystem, fetch, crypto, JWT, env and logging.

No Node runtimeExplicit Golt APIs
Go-native enginegoja + event loop
Docker-readyaztekode/golt:1.0.2
golt.dev v1.0.2
golt init my-api
cd my-api
code .
golt run app.ts
const app = Golt.App();

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

app.get("/", (ctx) => {
  ctx.Json({
    message: "Hello from Golt!",
    runtime: "golt",
  });
});

app.serve(3000);
const db = Golt.db.connect("sqlite", "./app.db");

await db.exec(
  "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)"
);

await db.exec("INSERT INTO users(name) VALUES (?)", "Ada");

const users = await db.query("SELECT id, name FROM users");

console.log(users);
docker pull aztekode/golt:1.0.2

docker run --rm \
  -p 3000:3000 \
  -v "$PWD":/workspace \
  -w /workspace \
  aztekode/golt:1.0.2 \
  run app.ts

Small surface. Clear runtime. Backend-ready.

Golt is designed for experiments, internal tools, small APIs and backend scripts where you want TypeScript ergonomics with Go-hosted runtime primitives.

Explicit by default

Instead of mirroring all of Node.js, Golt exposes only the primitives it owns and documents.

Friendly DX

golt init, golt run and golt watch keep the workflow simple.

Real backend APIs

HTTP routing, SQL access, filesystem helpers, bcrypt, JWT and fetch are available from the runtime.

Create a project and run it.

The CLI creates the runtime project. The VS Code extension handles editor typings when it detects golt.json.

quickstart bash
golt init my-api
cd my-api
golt run app.ts

app.ts

Your application entry file. It is bundled and executed by the runtime.

golt.json

Project metadata and workspace marker for the VS Code extension.

.vscode/extensions.json

Recommends Aztekode.golt-vscode for editor typings.

Run Golt anywhere with the official image.

Golt is available as a Docker image through aztekode/golt. Use it to run a local project without installing the runtime on the host, or as a base image for deployable Golt applications.

Official image

Pull aztekode/golt:latest or pin a specific version like aztekode/golt:1.0.2.

Local projects

Mount your current folder into /workspace and run golt run app.ts inside the container.

Production base

Use the image as a base for your own Golt app Dockerfile and expose your application port.

run with Docker bash
docker run --rm \
  -p 3000:3000 \
  -v "$PWD":/workspace \
  -w /workspace \
  aztekode/golt:1.0.2 \
  run app.ts
PowerShell windows
docker run --rm `
  -p 3000:3000 `
  -v "${PWD}:/workspace" `
  -w /workspace `
  aztekode/golt:1.0.2 `
  run app.ts
Dockerfile base image
FROM aztekode/golt:1.0.2

WORKDIR /app

COPY . .

EXPOSE 3000

CMD ["run", "app.ts"]
🐳
Recommended production usage: pin the version with aztekode/golt:1.0.2 instead of relying only on latest.

HTTP server

Golt.App() creates a per-app HTTP server with routes, middleware, static files and a not-found handler. Routes use Go-style path params like /users/{id}.

http.ts typescript
const app = Golt.App();

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

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

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

app.post("/users", (ctx) => {
  const body = ctx.ValidateBody({ name: "string" });
  if (!body) return;

  ctx.Status(201).Json({ ok: true, name: body.name });
});

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

app.serve(3000);
Runtime behavior: if a handler finishes without sending a response, Golt finalizes the request instead of leaving it hanging.

Database

Golt wraps Go database/sql. Use db.exec() for statements that do not return rows, and db.query() for statements that return data.

MethodUse it for
db.exec()CREATE, INSERT, UPDATE, DELETE, schema changes and writes.
db.query()SELECT and SQL statements that return rows.
database.ts typescript
const db = Golt.db.connect("sqlite", "./app.db");

const result = await db.exec(
  "INSERT INTO users(name) VALUES (?)",
  "Ada"
);

console.log(result.rowsAffected);

const users = await db.query<{ id: number; name: string }>(
  "SELECT id, name FROM users"
);

Fetch

Golt provides a minimal global fetch() powered by Go net/http. It supports method, headers, body and timeout.

fetch.ts typescript
const res = await fetch("https://httpbin.org/json", {
  method: "GET",
  timeout: 15000,
});

if (!res.ok) {
  console.log("Request failed:", res.status);
}

const data = await res.json();
console.log(data);

File system

Golt.fs exposes simple helpers for small read/write operations.

fs.ts typescript
Golt.fs.writeFile("./hello.txt", "Hello from Golt\n");

const text = Golt.fs.readFile("./hello.txt");

console.log(text);

Crypto & JWT

Golt.crypto provides bcrypt hashing. Golt.jwt signs and verifies HS256 tokens.

auth.ts typescript
const hash = await Golt.crypto.hash("password123");
const ok = await Golt.crypto.compare("password123", hash);

const token = Golt.jwt.sign({ sub: "user_123" }, "secret", 24);
const payload = Golt.jwt.verify(token, "secret");

console.log({ ok, payload });

CLI

The CLI keeps Golt focused on three actions: initialize, run and watch.

CommandDescription
golt init <name>Create a new project folder with app.ts, golt.json and VS Code recommendations.
golt run <file.ts>Bundle and execute a TypeScript entry file.
golt watch <file.ts>Run and restart on TypeScript or JavaScript file changes.
docker run aztekode/goltRun Golt from the official Docker image without installing the runtime locally.

Runtime API

This is the current small, explicit API surface exposed by Golt.

PrimitivePurpose
console.logPrint JS values to stdout.
Golt.AppCreate an HTTP app with routing, middleware and server start.
Golt.loggerCreate logging middleware for app.use().
Golt.dbConnect to SQL databases and run query() / exec().
Golt.fsRead and write local files.
Golt.cryptoHash and compare passwords with bcrypt.
Golt.jwtSign and verify JWT tokens.
Golt.envAccess host environment variables.
fetchMake outbound HTTP requests.