The package manager
PackageManager - Available PackageManager
The command type
Optionalargs: string | string[]Package names or arguments
The command variant.
The full command string, or undefined if not supported.
Automatically resolves the correct command syntax for the provided package manager and command variant.
Useful for generating commands dynamically across different package managers (PackageManager).
buildPmCommand(
'npm',
'install',
'typescript',
);
// "npm install typescript"
buildPmCommand(
'pnpm',
'install',
['react', 'react-dom'],
);
// "pnpm add react react-dom"
Builds a package manager command string.