Introducing Golt: A Lightweight TypeScript Runtime Powered by Go
Over the last few weeks, I have been working on Golt, a small TypeScript/JavaScript runtime written in Go.
The idea behind Golt is simple:
Write backend scripts and small APIs in TypeScript, then run them inside a Go-powered runtime with a small and explicit API surface.
Golt is not trying to be a full Node.js replacement. Instead, it focuses on a more controlled runtime experience where only the APIs provided by Golt are available.
Why Golt?
I wanted a runtime that could feel familiar for TypeScript developers, but still be powered by Go internally.
The goal is to keep the developer experience simple:
golt init my-api
cd my-api
golt run app.ts
And then write backend code like this:
const app = Golt.App();
app.use(Golt.logger({ format: "dev" }));
app.get("/", (ctx) => {
ctx.Json({
message: "Hello from Golt!",
runtime: "golt",
});
});
app.serve(3000);
Behind the scenes, Golt bundles the TypeScript entry file with esbuild and executes it inside a Go-hosted JavaScript engine.
What does Golt include?
Golt currently provides a small set of backend-focused APIs:
console.logGolt.envGolt.AppGolt.loggerGolt.dbGolt.fsGolt.cryptoGolt.jwt- global
fetch()
The idea is to keep the runtime surface small, predictable and easy to document.
HTTP server
Golt includes a simple HTTP server API:
const app = Golt.App();
app.get("/", (ctx) => {
ctx.Send("Hello from Golt HTTP");
});
app.get("/users/{id}", (ctx) => {
ctx.Json({
id: ctx.Param("id"),
});
});
app.notFound((ctx) => {
ctx.Status(404).Send("not found");
});
app.serve(3000);
Routes support Go-style path parameters like:
/users/{id}
And handlers receive a Context object with helpers like:
ctx.Param("id");
ctx.Query("q");
ctx.Status(201);
ctx.Json(data);
ctx.Send("text");
Database access
Golt wraps Go's database/sql package and exposes Promise-based database helpers.
The API separates commands that mutate state from commands that return rows:
const db = Golt.db.connect("sqlite", "./app.db");
await db.exec(`
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
)
`);
await db.exec("INSERT INTO users(name) VALUES (?)", "Ada");
const users = await db.query("SELECT id, name FROM users");
console.log(users);
The intended pattern is:
await db.exec("INSERT / UPDATE / DELETE / CREATE ...");
const rows = await db.query("SELECT ...");
Fetch, filesystem, crypto and JWT
Golt also includes a minimal fetch() implementation:
const response = await fetch("https://httpbin.org/json");
const data = await response.json();
console.log(data);
Filesystem helpers:
Golt.fs.writeFile("./hello.txt", "Hello from Golt\n");
const content = Golt.fs.readFile("./hello.txt");
console.log(content);
Password hashing and JWT helpers:
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 });
Docker support
Golt is also available as a Docker image:
docker pull aztekode/golt:latest
You can run a Golt project without installing the runtime locally:
docker run --rm \
-p 3000:3000 \
-v "$PWD":/workspace \
-w /workspace \
aztekode/golt:latest \
run app.ts
Or use it as a base image:
FROM aztekode/golt:latest
WORKDIR /app
COPY . .
EXPOSE 3000
CMD ["run", "app.ts"]
This makes it easier to run Golt projects consistently across different environments.
VS Code support
Golt also has a VS Code extension that provides editor typings.
When the extension detects a golt.json file in the workspace, it can generate the required type definitions under .golt/types.
The goal is to keep the CLI focused on the runtime and let the editor extension handle TypeScript developer experience.
Current project status
Golt is still early, but the base runtime is already working.
The current focus is:
- improving runtime stability
- improving the CLI
- improving Docker usage
- improving documentation
- keeping the API small and intentional
Future ideas include:
- better request body helpers
- improved validation
- better source map support
- more polished error messages
- more production-oriented examples
Links
- Website: https://golt.dev
- GitHub: https://github.com/atrox39/golt
- Docker image: https://hub.docker.com/r/aztekode/golt
- VS Code Extension: https://marketplace.visualstudio.com/items?itemName=Aztekode.golt-vscode
Final thoughts
Golt started as an experiment around the idea of running TypeScript on top of a Go-powered runtime.
It is not meant to compete directly with Node.js, Deno or Bun. Instead, it explores a smaller runtime model focused on explicit backend primitives.
If you like TypeScript, Go, runtimes, backend tooling or developer experience experiments, I would love to hear your feedback.
Top comments (0)