Documentation
¶
Overview ¶
pkgmod scans a JavaScript/TypeScript source tree, compares the imports it finds against the project's package.json, and installs anything missing.
Usage:
pkgmod --src=./src pkgmod --src=./src --manager=bun # override when packageManager field is absent
The package manager is resolved in this order:
- packageManager field in package.json (e.g. "pnpm@9.1.0") — if present and supported
- --manager flag — used when the field is absent
package.json is always read from the current working directory (project root).
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cmd wires together the scanner, deps loader, installer, and TUI into the top-level CLI command.
|
Package cmd wires together the scanner, deps loader, installer, and TUI into the top-level CLI command. |
|
Package deps handles everything related to the project's declared dependencies: reading and parsing package.json, normalising package name keys (which pnpm sometimes writes with an "@version" suffix), computing the diff between what the source code imports and what is already declared, and resolving which package manager to use.
|
Package deps handles everything related to the project's declared dependencies: reading and parsing package.json, normalising package name keys (which pnpm sometimes writes with an "@version" suffix), computing the diff between what the source code imports and what is already declared, and resolving which package manager to use. |
|
Package installer defines the Installer interface, the Manager enum of supported package managers, and a factory function that maps an enum value to its concrete implementation.
|
Package installer defines the Installer interface, the Manager enum of supported package managers, and a factory function that maps an enum value to its concrete implementation. |
|
Package scanner walks a JavaScript/TypeScript source tree and extracts the set of third-party package names referenced by import and require statements.
|
Package scanner walks a JavaScript/TypeScript source tree and extracts the set of third-party package names referenced by import and require statements. |
|
Package tui provides the interactive terminal UI for selecting which packages to install.
|
Package tui provides the interactive terminal UI for selecting which packages to install. |
Click to show internal directories.
Click to hide internal directories.