@zuke/pnpm
`@zuke/pnpm` — typed `PnpmTasks` wrappers for the `pnpm` CLI, for use in Zuke
@zuke/pnpm on JSR ↗ 10 symbols
Symbols
type PnpmAccess = public | restricted An access level accepted by pnpm's --access flag.
class PnpmAddSettings extends PnpmSettings Settings for pnpm add.
| Member | Signature | Doc |
|---|---|---|
packages | packages(...specs: string[]): this | Package specs to add (required). |
saveDev | saveDev(): this | Save to devDependencies (--save-dev). |
saveExact | saveExact(): this | Pin the exact version (--save-exact). |
global | global(): this | Install globally (--global). |
class PnpmDlxSettings extends PnpmSettings Settings for pnpm dlx.
| Member | Signature | Doc |
|---|---|---|
command | command(name: string): this | The command to execute (required). |
package | package(spec: string): this | The package providing the command (--package=). |
execArgs | execArgs(...args: Array<string | number>): this | Arguments forwarded to the command. |
class PnpmInstallSettings extends PnpmSettings Settings for pnpm install.
| Member | Signature | Doc |
|---|---|---|
frozenLockfile | frozenLockfile(): this | Fail if the lockfile is out of date (--frozen-lockfile). |
prod | prod(): this | Install without devDependencies (--prod). |
class PnpmPublishSettings extends PnpmSettings Settings for pnpm publish.
| Member | Signature | Doc |
|---|---|---|
tag | tag(name: string): this | Publish under a dist-tag (--tag=). |
access | access(level: PnpmAccess): this | Set the package access level (--access=). |
noGitChecks | noGitChecks(): this | Skip the clean-working-tree checks (--no-git-checks). |
dryRun | dryRun(): this | Report what would be published without uploading (--dry-run). |
class PnpmRemoveSettings extends PnpmSettings Settings for pnpm remove.
| Member | Signature | Doc |
|---|---|---|
packages | packages(...names: string[]): this | Package names to remove (required). |
class PnpmRunSettings extends PnpmSettings Settings for pnpm run.
| Member | Signature | Doc |
|---|---|---|
script | script(name: string): this | The package.json script to run (required). |
filter | filter(pattern: string): this | Restrict to matching workspace packages (--filter). |
ifPresent | ifPresent(): this | Do not fail when the script is missing (--if-present). |
scriptArgs | scriptArgs(...args: Array<string | number>): this | Arguments forwarded to the script. |
class PnpmSettings extends ToolSettings Base for all pnpm subcommand settings: binary is pnpm from PATH.
const PnpmTasks: PnpmTasksApi Typed task functions for the pnpm CLI.
interface PnpmTasksApi The shape of PnpmTasks.
| Member | Signature | Doc |
|---|---|---|
install | install(configure?: Configure<PnpmInstallSettings>): Promise<CommandOutput> | Install dependencies: pnpm install. |
add | add(configure?: Configure<PnpmAddSettings>): Promise<CommandOutput> | Add dependencies: pnpm add. |
remove | remove(configure?: Configure<PnpmRemoveSettings>): Promise<CommandOutput> | Remove dependencies: pnpm remove. |
run | run(configure?: Configure<PnpmRunSettings>): Promise<CommandOutput> | Run a package.json script: pnpm run. |
dlx | dlx(configure?: Configure<PnpmDlxSettings>): Promise<CommandOutput> | Download and execute a package binary: pnpm dlx. |
publish | publish(configure?: Configure<PnpmPublishSettings>): Promise<CommandOutput> | Publish the package: pnpm publish. |