@zuke/pnpm

← API reference

`@zuke/pnpm` — typed `PnpmTasks` wrappers for the `pnpm` CLI, for use in Zuke

Symbols

# PnpmAccess type
type PnpmAccess = public | restricted

An access level accepted by pnpm's --access flag.

# PnpmAddSettings class
class PnpmAddSettings extends PnpmSettings

Settings for pnpm add.

MemberSignatureDoc
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).
# PnpmDlxSettings class
class PnpmDlxSettings extends PnpmSettings

Settings for pnpm dlx.

MemberSignatureDoc
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.
# PnpmInstallSettings class
class PnpmInstallSettings extends PnpmSettings

Settings for pnpm install.

MemberSignatureDoc
frozenLockfile frozenLockfile(): this Fail if the lockfile is out of date (--frozen-lockfile).
prod prod(): this Install without devDependencies (--prod).
# PnpmPublishSettings class
class PnpmPublishSettings extends PnpmSettings

Settings for pnpm publish.

MemberSignatureDoc
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).
# PnpmRemoveSettings class
class PnpmRemoveSettings extends PnpmSettings

Settings for pnpm remove.

MemberSignatureDoc
packages packages(...names: string[]): this Package names to remove (required).
# PnpmRunSettings class
class PnpmRunSettings extends PnpmSettings

Settings for pnpm run.

MemberSignatureDoc
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.
# PnpmSettings class
class PnpmSettings extends ToolSettings

Base for all pnpm subcommand settings: binary is pnpm from PATH.

# PnpmTasks const
const PnpmTasks: PnpmTasksApi

Typed task functions for the pnpm CLI.

# PnpmTasksApi interface
interface PnpmTasksApi

The shape of PnpmTasks.

MemberSignatureDoc
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.