class NodePackageManager (View source)

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

__construct(NodePackageManager|null $packageManager = null)

Create a new NodePackageManager manager instance.

Parameters

NodePackageManager|null $packageManager

string getExecCommand(string $command)

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

Parameters

string $command

Return Value

string

string getRunCommand(string $command)

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

Parameters

string $command

Return Value

string

NodePackageManager packageManager()

Get the Node package manager in use.

Return Value

NodePackageManager

protected NodePackageManager detect()

Detect the current package manager.

Return Value

NodePackageManager

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.