API overview
Find public APIs by task, with contracts, usage guides and complete upstream references.
Start from the task
The reference contains all 36 public namespaces and 251 documented symbols at the displayed source revision. Each namespace retains upstream signatures, descriptions and pinned source links. Guides explain how the APIs fit together; example pages contain complete programs and build files.
| Task | API | Learn and run |
|---|---|---|
| Adapt Fetch / route requests | routing | Request/response contract, routing guide, Hello World |
| Start/stop an HTTP or TCP server | server.core | Listener options, TCP exchange |
| Request HTTP, connect sockets, read streams, send port messages | client.core | All native options, transport examples |
| Produce SSE | server.sse | SSE guide, complete exchange |
| Select/start/shut down a native runtime at compile time | macros | Startup guide, Worker example |
| Render a CSRF form field | util.anti-forgery | Session/form flow |
Request processing
| Namespace | What it supplies |
|---|---|
| middlewares.common | Header, request conversion and Promise-aware wrapper helpers |
| middlewares.defaults | API/site settings and configured wrapper composition |
| middlewares.params | Query and URL-encoded form parsing |
| middlewares.multipart-params | Multipart fields and native uploaded files |
| middlewares.nested-params | Bracketed nested form names |
| middlewares.keyword-params | Parsed-map keyword conversion |
| middlewares.method-override | Configured POST method overrides |
| middlewares.cookies | Cookie parsing and Set-Cookie serialization |
| middlewares.session | Session loading, writing, deletion and process-memory stores |
| middlewares.flash | One-time session data |
| middlewares.anti-forgery | Token validation, rendering bindings and failure hooks |
| middlewares.request-id | Request identity generation/propagation |
| middlewares.request-size-limit | Declared Content-Length checks |
| middlewares.rate-limit | Per-key token buckets |
| middlewares.timeout | Promise/callback response timeout |
| middlewares.logging | Request completion events |
| middlewares.proxy-headers | Forwarded host/scheme/IP adaptation |
Response and asset processing
| Namespace | What it supplies |
|---|---|
| middlewares.absolute-redirects | Absolute Location headers |
| middlewares.cache-policy | Configurable cache headers and policy memoization |
| middlewares.content-length | Supported body byte-length headers |
| middlewares.content-security-policy | Structured CSP configuration and formatting |
| middlewares.content-type | MIME inference, sniffing and upload summaries |
| middlewares.default-charset | Text charset fallback |
| middlewares.file | Filesystem file serving |
| middlewares.file-info | Metadata/header enrichment |
| middlewares.resource | File-based resource serving |
| middlewares.head | HEAD adaptation and discarded-body cleanup |
| middlewares.not-modified | Conditional 304 responses |
| middlewares.ssl | HTTPS redirect and HSTS |
| middlewares.x-headers | Configured X response headers |
Middleware configuration and execution order explains defaults, concrete composition, session updates and every wrapper family. Files and caching covers root/URL mapping, byte metadata and static-policy constraints.
Understand a signature
([request] [request options]) means two supported arities, not optional positional arguments that can be mixed arbitrarily. Alias names in examples come from the namespace's require form. A callback handler uses request/respond/raise; a Promise-returning handler uses normal request arity. Native option maps are validated and transport-specific; a function name alone does not define runtime capabilities.
Check inputs, output, async behavior, ownership and failure before copying a call. Native contract tables and reader ownership make these distinctions explicit.