Key Features
Native Performance
Ant’s package manager is written in Zig and C, providing:- Fast installs - Parallel fetching and linking with optimized caching
- Binary lockfile -
ant.lockbformat with memory-mapped access for instant reads - Efficient linking - Hardlinks on Unix, optimized copies on Windows
- Smart caching - LMDB-based cache database with integrity verification
Security First
Unlike npm, Ant requires explicit trust before running lifecycle scripts:trustedDependencies in your package.json.
npm Compatibility
Ant works with the npm ecosystem:- Reads standard
package.jsonfiles - Fetches from npm registry by default
- Supports npm version ranges and semver
- Compatible with npm package structure
Installation Workflow
When you runant install or ant add, the package manager:
- Resolves - Reads
package.jsonand resolves dependency tree - Fetches - Downloads missing packages in parallel (up to 6 connections)
- Extracts - Unpacks tarballs to cache directory
- Links - Creates
node_moduleswith hardlinks to cached packages - Writes lockfile - Generates binary
ant.lockbwith exact versions
Cache Architecture
Cache Location
Cache Database
Ant uses LMDB (Lightning Memory-Mapped Database) to track:- Primary index - Lookup by integrity hash (SHA-512)
- Secondary index - Lookup by name@version
- Metadata cache - Registry responses with 24-hour TTL
Cache Operations
Lockfile Format
Theant.lockb binary lockfile uses a custom format:
Global Packages
Install packages globally with the-g flag:
~/.ant/pkg/global/node_modules/ and binaries are symlinked to ~/.ant/bin/.
Command Overview
| Command | Alias | Description |
|---|---|---|
init | - | Create a new package.json |
install | i | Install dependencies from lockfile |
add | a | Add packages to dependencies |
remove | rm | Remove packages from dependencies |
update | up | Re-resolve and update dependencies |
run | - | Run package.json scripts |
exec | x | Run binaries from node_modules/.bin |
why | explain | Show why a package is installed |
info | - | Show package information from registry |
ls | list | List installed packages |
trust | - | Run lifecycle scripts for packages |
cache | - | Manage the package cache |
create | - | Scaffold project from template |
Progress Reporting
Ant displays real-time progress during installs:- 🔍 Resolving - Reading lockfile and resolving versions
- 🚚 Fetching - Downloading tarballs from registry
- 📦 Extracting - Unpacking tarballs to cache
- 🔗 Linking - Creating node_modules structure
- 💾 Caching - Writing to cache database
- ⚙️ Postinstall - Running lifecycle scripts
Verbose Mode
Enable detailed logging with--verbose:
- Cache hits and misses
- HTTP requests and responses
- File operations
- Timing information
Next Steps
- Commands Reference - Complete CLI command documentation
- Configuration - package.json configuration options
- Lockfile Format - Binary lockfile specification