Supported package managers
PM-Auto supports four package managers:npm
The default Node.js package manager, included with every Node.js installation.
pnpm
A fast, disk-efficient package manager that uses a content-addressable store.
yarn
A popular alternative to npm with improved performance and security features.
bun
A modern JavaScript runtime with a built-in ultra-fast package manager.
Command mapping
PM-Auto maps your preset configuration to package manager-specific commands. Here’s how each manager translates common operations:Install commands
| Operation | npm | pnpm | yarn | bun |
|---|---|---|---|---|
| Install package | npm install | pnpm add | yarn add | bun add |
| Run package | npx | pnpm dlx | yarn dlx | bunx |
| Dev flag | -D | -D | -D | -d |
Implementation details
Here’s the exact command mapping from PM-Auto’s source code:Notice that bun uses
-d for dev dependencies instead of -D. PM-Auto handles this difference automatically.Uninstall commands
| Operation | npm | pnpm | yarn | bun |
|---|---|---|---|---|
| Remove package | npm uninstall | pnpm remove | yarn remove | bun remove |
How PM-Auto translates commands
When you runpm-auto install, PM-Auto processes your preset and generates the appropriate commands for your chosen package manager.
Example: Installing non-interactive packages
Given this preset configuration:Example: Running interactive packages
For interactive packages (like project scaffolding tools), PM-Auto uses the package manager’s run command:Choosing the right package manager
When creating a preset, consider these factors:Speed
Fastest: bun > pnpm > yarn > npm If installation speed is critical (especially for CI/CD), consider bun or pnpm.Compatibility
Most compatible: npm Npm has the broadest compatibility with legacy projects and tools. If you need maximum compatibility, use npm.Disk space
Most efficient: pnpm Pnpm uses a global store and hard links, saving significant disk space when you have multiple projects.Team considerations
Choose the package manager your team already uses. Consistency matters more than marginal performance differences.Same preset, different package managers
You can create multiple versions of the same preset for different package managers. This is useful when sharing presets across teams with different preferences.Example: React starter presets
packageManager field changes. PM-Auto handles all the command translation.
Package manager detection
PM-Auto uses thepackageManager field in your preset to determine which commands to generate. It doesn’t automatically detect which package manager is installed or used in the current project.
If you specify a package manager that isn’t installed on your system, the commands will fail. Make sure the package manager specified in your preset is available in your environment.