pkgmod

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2026 License: MIT Imports: 3 Imported by: 0

README

pkgmod

auto download uninstalled dependancies for typescript project.

install

go install github.com/kaleb110/pkgmod

usage


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:

  1. packageManager field in package.json (e.g. "pnpm@9.1.0") — if present and supported
  2. --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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL