withNpm

Method
📦 Aspire.Hosting.JavaScript v17.0.0
interface BunAppResource {
// ... omitted for brevity
withNpm(
install?: boolean,
installCommand?: string,
installArgs?: string[]): JavaScriptAppResource;
}

Signature

methodwithNpmbuilder
Configures the Node.js resource to use npm as the package manager and optionally installs packages before the application starts.
withNpm(
install?: boolean,
installCommand?: string,
installArgs?: string[]): JavaScriptAppResource
installbooleanoptional= TrueWhen true (default), automatically installs packages before the application starts. When false, only sets the package manager annotation without creating an installer resource.
installCommandstringoptionalThe install command itself passed to npm to install dependencies.
installArgsstring[]optionalThe command-line arguments passed to npm to install dependencies.
JavaScriptAppResource

Applies to

This method applies to the following types: