TypeScript library for APT package operations on Debian-based Linux systems. It supports both standard APT binaries and the apt-fast bundled wrapper.
Note
If you find this project useful, please consider supporting it as a sponsor and show some ❤️ for open source maintainers.
- Install, remove, and upgrade packages
- Search package repositories
- List installed packages and upgradable packages
- Get package metadata and installed file lists
- Run cache cleanup and autoremove operations
- Use apt-fast when available, with automatic fallback to apt-get
- Structured command execution via pluggable command runners
- Typed error model for validation, availability, and command failures
- Safe locking support for mutating operations and parallelism for read-only operations
- Node.js 24+
- Linux environment with APT tooling available
npm install ts-aptimport { createPackageManager } from "ts-apt";
const manager = await createPackageManager(false);
const searchResults = await manager.search(["vim"]);
const installed = await manager.listInstalled();
console.log(searchResults.length, installed.length);npm run test:unit
npm run test:integrationIntegration tests run against real APT tooling and are slower than unit tests.
Generate API docs:
npm run docs:apiGenerated docs are written to docs/api.
- ilikenwf/apt-fast - Optimized fast APT downloads.
- moll/js-internet-message - RFC compliant parsing of some apt output to avoid brittle string parsing.
Development workflows, CI/release behavior, and repository maintenance guidance are documented in CONTRIBUTING.md.
PRs are gated by branch policy checks, and releases are published from main and staging via semantic-release.