class NodePackageManager

Methods

__construct(NodePackageManager|null $packageManager = null)

Create a new NodePackageManager manager instance.

string
getExecCommand(string $command)

Get the command to execute a package using the detected package manager.

string
getRunCommand(string $command)

Get the command to run a script using the detected package manager.

packageManager()

Get the Node package manager in use.

detect()

Detect the current package manager.

Details

at line 14
__construct(NodePackageManager|null $packageManager = null)

Create a new NodePackageManager manager instance.

Parameters

NodePackageManager|null $packageManager

at line 21
string getExecCommand(string $command)

Get the command to execute a package using the detected package manager.

Parameters

string $command

Return Value

string

at line 29
string getRunCommand(string $command)

Get the command to run a script using the detected package manager.

Parameters

string $command

Return Value

string

at line 37
NodePackageManager packageManager()

Get the Node package manager in use.

Return Value

NodePackageManager

at line 45
protected NodePackageManager detect()

Detect the current package manager.

Return Value

NodePackageManager