Skip to content

getPackageManagerRunCommand

Builds the command parts that run a package script through the manager that owns the tree.

Import:

import { getPackageManagerRunCommand } from 'obsidian-dev-utils/script-utils/package-manager';

Signature:

function getPackageManagerRunCommand(cwd: string | undefined): string[]

Parameters:

ParameterTypeDescription
cwdstring | undefinedThe current working folder to resolve from.

Returns: string[] — The command parts, e.g. ['bun', 'run']. The script name is appended by the caller.