https://registry.npmjs.org, reads the standard package.json format without any special configuration, and provides Node-compatible built-in modules so packages that import node:fs, node:path, or node:crypto work without shims. Most packages you already use will run in Ant without modification.
Registry and resolution
When you runant add hono or ant install, Ant contacts the npm registry directly to resolve package metadata and download tarballs. No npm client, no Bun, no separate package manager binary is required.
The resolved dependency tree is written to ant.lockb, a binary lockfile that records the exact version, tarball URL, and integrity hash for every package. Commit ant.lockb to version control so every developer and CI environment installs byte-for-byte identical packages.
ant.lockb is written and read by Ant automatically. You do not need to interact with it directly. Run ant update to re-resolve and refresh it.Supported package.json fields
Ant reads the following fields from package.json:
| Field | Purpose |
|---|---|
name | Package identifier |
version | Semver version string |
type | "module" (ESM) or "commonjs" |
main | CommonJS entry point |
module | ESM entry point (preferred over main for ESM consumers) |
exports | Subpath exports map — Ant resolves conditions including import, require, and default |
scripts | Commands runnable with ant run |
dependencies | Runtime dependencies |
devDependencies | Development-only dependencies |
Module format compatibility
- ESM
- CommonJS
- TypeScript
Ant natively runs ESM. Use
import and export syntax freely in .js, .mjs, and .ts files. Set "type": "module" in package.json to treat all .js files as ESM.package.json
src/index.ts
Node-compatible built-ins
Ant provides built-in implementations of the standard Node.js modules. Any npm package that imports these modules will resolve them correctly — no polyfills or bundler configuration needed.node: prefix and the bare name (for example import fs from 'fs' and import fs from 'node:fs' both work):
Ant-specific modules
Ant exposes several runtime modules under theant: prefix. These are Ant-only — they are not available in Node.js or Bun, and no npm package will accidentally import them.
| Module | Description |
|---|---|
ant:ffi | Foreign function interface for calling native C libraries |
ant:shell | Shell command execution utilities |
ant:lmdb | Embedded LMDB key-value database |
Real-world example: Hono web server
The following example is taken directly fromexamples/npm/hono in the Ant repository. It shows a minimal HTTP server using the Hono framework, a popular ESM-first web framework that publishes to the npm registry.
Packages known to work
The Ant repository includes integration examples for the following npm packages. All resolve and run from the npm registry without modification:hono
Lightweight, ultrafast web framework with full middleware support.
elysia
TypeScript-first, end-to-end type-safe web framework.
express
The classic Node.js HTTP framework.
esbuild
Extremely fast JavaScript/TypeScript bundler and minifier.
preact
Fast 3kB React-compatible UI library.
react
The React library and related packages.
rolldown
Fast Rust-based JavaScript bundler.
undici
Low-level HTTP/1.1 client for Node-compatible runtimes.
ky
Tiny and elegant HTTP client based on the Fetch API.