Skip to content

javascript-package-delegator (jpd)

A universal JavaScript package manager CLI written in Go that automatically detects and delegates to npm, Yarn, pnpm, Bun, and Deno.
Documentation for jpd 3.0.0

javascript-package-delegator (jpd) is a powerful CLI tool that eliminates the friction of working across JavaScript projects with different package managers. Instead of remembering whether a project uses npm install, yarn add, pnpm add, or bun add, you simply use jpd install and let the tool figure out the rest.

Inspired by @antfu/ni, jpd automatically detects your project’s package manager by analyzing lock files and configuration, then transparently delegates commands to the appropriate tool. This creates a unified development experience that’s especially valuable for:

  • Teams with diverse preferences (some prefer npm, others prefer pnpm)
  • Polyglot developers switching between Node.js and Deno projects
  • Monorepos with different package managers in different workspaces
  • Open source contributors working across many different projects

Automatic Detection

Intelligently identifies package managers by checking for package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb, deno.json, and more.

Unified Commands

One consistent API for install, run, exec, create, update, uninstall, and clean-install across all supported package managers.

Interactive Workflows

Search npm registry interactively, select scripts/tasks from a menu, and choose dependencies to uninstall with built-in UI.

Volta Integration

Automatically uses Volta when detected to ensure consistent Node.js versions across your environments.

Shell Completion

Generate completion scripts for Bash, Zsh, Fish, PowerShell, and Nushell to boost productivity and reduce errors.

Debug Mode

Built-in debugging with --debug flag shows exactly what commands are being executed behind the scenes.

External Integrations

Generate Warp terminal workflows and Carapace completion specs with one command.

jpd seamlessly works with all major JavaScript package managers:

  • npm - The default Node.js package manager
  • Yarn - Both v1 (Classic) and v2+ (Berry) with intelligent version detection
  • pnpm - Fast, disk space efficient package manager
  • Bun - All-in-one JavaScript runtime and toolkit
  • Deno - Secure runtime with built-in TypeScript support

Get up and running in under a minute:

Terminal window
# Install jpd
brew install louiss0/tap/jpd
# Detect your project's package manager
jpd agent
# Install dependencies (equivalent to npm/yarn/pnpm/bun install)
jpd install
# Run a script interactively
jpd run
# Generate and view Carapace spec (no install)
jpd integrate carapace --stdout
# Generate Warp workflows to a folder
jpd integrate warp --output-dir ./workflows/

jpd follows a clean Why/What/How CLI design:

  • Why (Root): jpd represents the universal package manager interface
  • What (Subcommands): install, run, exec, update, etc. represent the actions you want to take
  • How (Flags): --agent, --cwd, --debug modify how those actions are executed

This design makes jpd predictable and easy to learn, whether you’re a newcomer or switching from existing tools.

Tutorial

Get started with installation and basic usage patterns.

Commands Reference

Browse the complete command reference with all flags and examples.