package.json from the lockfile, or add new packages when specified.
Usage
Parameters
Package specifications to install. When provided, behaves like
ant add.Formats:package-name- Latest versionpackage-name@version- Specific versionpackage-name@tag- Dist tag (e.g.,@next,@beta)
Options
Install packages globally to
~/.ant/pkg/global.Add packages as devDependencies.
Enable verbose output with detailed progress information.
Display help information.
Examples
Install from lockfile
Install and add packages
Install as dev dependency
Global installation
No changes needed
Behavior
Without packages argument
- Installs from existing lockfile if present
- Resolves and creates lockfile if none exists
- Requires
package.jsonin current directory
With packages argument
- Adds packages to
package.json - Updates lockfile
- Installs all dependencies
Lockfile
Ant usesant.lockb (binary format) for faster parsing and smaller size.
Cache
Installed packages are cached in~/.ant/pkg/cache for faster subsequent installs.
Lifecycle Scripts
If packages have lifecycle scripts (postinstall, etc.), Ant will prompt:Related
- ant add - Add packages to dependencies
- ant update - Update dependencies
- ant remove - Remove packages