@zuke/yarn

← API reference

`@zuke/yarn` — typed `YarnTasks` wrappers for the `yarn` CLI, for use in Zuke

Symbols

# YarnAddSettings class
class YarnAddSettings extends YarnSettings

Settings for yarn add.

MemberSignatureDoc
packages packages(...specs: string[]): this Package specs to add (required).
dev dev(): this Add to devDependencies (--dev).
exact exact(): this Pin the exact version (--exact).
# YarnDlxSettings class
class YarnDlxSettings extends YarnSettings

Settings for yarn dlx (Yarn Berry's one-off package runner).

MemberSignatureDoc
command command(name: string): this The command to execute (required).
package package(spec: string): this An extra package to make available (--package).
execArgs execArgs(...args: Array<string | number>): this Arguments forwarded to the command.
# YarnInstallSettings class
class YarnInstallSettings extends YarnSettings

Settings for yarn install.

MemberSignatureDoc
immutable immutable(): this Fail if the lockfile would change — --immutable (Yarn Berry).
frozenLockfile frozenLockfile(): this Fail if the lockfile would change — --frozen-lockfile (Yarn Classic).
# YarnRemoveSettings class
class YarnRemoveSettings extends YarnSettings

Settings for yarn remove.

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

Settings for yarn run.

MemberSignatureDoc
script script(name: string): this The package.json script to run (required).
scriptArgs scriptArgs(...args: Array<string | number>): this Arguments forwarded to the script.
# YarnSettings class
class YarnSettings extends ToolSettings

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

# YarnTasks const
const YarnTasks: YarnTasksApi

Typed task functions for the yarn CLI.

# YarnTasksApi interface
interface YarnTasksApi

The shape of YarnTasks.

MemberSignatureDoc
install install(configure?: Configure<YarnInstallSettings>): Promise<CommandOutput> Install dependencies: yarn install.
add add(configure?: Configure<YarnAddSettings>): Promise<CommandOutput> Add dependencies: yarn add.
remove remove(configure?: Configure<YarnRemoveSettings>): Promise<CommandOutput> Remove dependencies: yarn remove.
run run(configure?: Configure<YarnRunSettings>): Promise<CommandOutput> Run a package.json script: yarn run.
dlx dlx(configure?: Configure<YarnDlxSettings>): Promise<CommandOutput> Download and execute a package binary: yarn dlx (Berry).