console.log to a full HTTP server powered by Hono in about five minutes.
Run a JavaScript file
Create a file called Run it:You should see the greeting printed with the current Ant version. The global
hello.js:hello.js
Ant object is always available and exposes runtime metadata.Run a TypeScript file
Ant strips TypeScript types at load time using the built-in OXC-based type stripper. No Run it exactly like a
tsconfig.json, no tsc, no separate build step.Create hello.ts:hello.ts
.js file:Type checking is not performed at runtime — Ant strips annotations and runs the result. Use your editor’s language server or
tsc --noEmit if you want type errors caught before execution.Evaluate an expression inline
For quick one-liners, use the This is useful for scripting and shell pipelines where you don’t want to create a temporary file.
-e flag to pass a script directly on the command line:Start an HTTP server
Ant’s HTTP server follows the WinterTC Run it:Open The
fetch handler pattern: export a default object with a fetch method, and Ant starts listening automatically.Create server.js:server.js
http://localhost:3000 in your browser or hit it with curl:server argument passed to fetch exposes the server instance. You can call server.stop() from inside a handler to shut the server down programmatically — useful for ephemeral servers in scripts or tests:ephemeral_server.js
Add an npm package and build a Hono server
Ant resolves npm packages from a local Then create Run it:Hono’s default export is a WinterTC-compatible handler, so Ant picks it up automatically and starts the server. Visit
node_modules directory. Add a package with ant add:index.ts:index.ts
http://localhost:3000 to see the response.What to explore next
Built-in modules
Ant ships built-in modules for the file system, path, crypto, streams, and more — importable via the
ant: prefix (e.g. import { readFile } from 'ant:fs').FFI
Call native shared libraries from JavaScript using Ant’s Foreign Function Interface.
WebAssembly
Run
.wasm modules directly in Ant alongside your JavaScript code.Embedding Ant
Embed the Ant runtime in your own C or C++ application via the
libant C API.