pkgmod

command module
v1.0.2 Latest Latest
Warning

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

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

README

pkgmod

a golang cli app to auto download uninstalled dependancies for typescript project. made with go standard library with bubbletea as a cli library.

install

go install github.com/kaleb110/pkgmod@latest

usage

$ pkgmod # runs on the current dir
$ pkgmod -src=src # runs on src dir
$ pkgmod -src=src -manager=pnpm # manager flag sets your package manager

supported managers

  • npm, pnpm, bun, yarn
  • add packageManager to your package.json to enable auto detection

features

  • auto download uninstalled packages
  • support for pupular package managers
  • ESM + CJS support
  • sync with package.json

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