Documentation / @zerotal/core / index
index
The Zerotal kernel — the IoC container, application lifecycle, HTTP router and pipeline, service providers, events, facades, and the common request helpers that every Zerotal app builds on.
@zerotal/core is the one package every app depends on. This root entry
carries only the hot, cheap kernel used across the framework — Application,
the Container, HttpContext, the Router, middleware,
providers, events, facades, and helpers. Heavier or cohesive
subsystems live behind explicit subpaths so importing the kernel never drags
them in:
| Subpath | What it provides |
|---|---|
@zerotal/core/contracts | Interface-only seams packages implement and the kernel consumes (session, transaction, authenticatable user) |
@zerotal/core/carbon | Date/time via Carbon (pulls the Temporal polyfill) |
@zerotal/core/http | Outbound HTTP client, URL building, uploads, API resources, content negotiation |
@zerotal/core/view | Server-side JSX runtime + authoring helpers |
@zerotal/core/env | Typed environment-variable schema |
@zerotal/core/config | Config manager/loader + app config shapes |
@zerotal/core/security | Crypt + Hash |
@zerotal/core/logger | Structured logging (Log, channels) |
@zerotal/core/lock | Distributed locks |
@zerotal/core/commands | Built-in CLI commands |
@zerotal/core/dev | Dev-only build/reload tooling (owns Bun.build) |
@zerotal/core/assets | Asset URL helper + versioning |
@zerotal/core/health | Health checks |
@zerotal/core/metrics | HTTP request metrics |
Examples
Bootstrap an application
// bootstrap/app.ts
import { Application } from "@zerotal/core";
import providers from "./providers.ts";
const app = Application.create({ providers, env: "web" });
await app.start();
Define routes and a controller
import { Router } from "@zerotal/core";
Router.get("/", (ctx) => ctx.html("<h1>Hello</h1>"));
Router.get("/users/{id}", (ctx) => ctx.json({ id: ctx.params.id }));
Remarks
Zerotal runs on Bun ≥ 1.1 — Node.js is not supported. The framework uses
Bun.sql, Bun.CryptoHasher, Bun.build, and other Bun-native APIs
throughout.
Application lifecycle
Console
Contracts
Extension registries
HTTP
Naming & URLs
Other
env
Re-exports env
requireEnv
Re-exports requireEnv
setAppEnv
Re-exports setAppEnv
basePath
Re-exports basePath
tap
Re-exports tap
tapAsync
Re-exports tapAsync
pipe
Re-exports pipe
pipeAsync
Re-exports pipeAsync
rescue
Re-exports rescue
rescueSync
Re-exports rescueSync
data_get
Re-exports data_get
FileRouteHandler
Renames and re-exports FileHandler