# JavaScriptAppResource.WithBun

- Module: [Aspire.Hosting.JavaScript](/reference/api/go/aspire.hosting.javascript.md)
- Defined on: [JavaScriptAppResource](/reference/api/go/aspire.hosting.javascript/javascriptappresource.md)
- Version: `17.0.0`
- Kind: `method`

Configures the JavaScript resource to use Bun as the package manager and optionally installs packages before the application starts.

## Definition

```go
type JavaScriptAppResource interface {
    // ... omitted for brevity
    WithBun(options ...*WithBunOptions) JavaScriptAppResource
}
```

## Signature

```go
WithBun(options ...*WithBunOptions) JavaScriptAppResource
```

## Parameters

- `options` (`...*WithBunOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithBunOptions` argument.

- `Install` (`*bool`) -- When true (default), automatically installs packages before the application starts. When false, only sets the package manager annotation without creating an installer resource.
- `InstallArgs` (`[]string`) -- Additional command-line arguments passed to "bun install". When null, defaults are applied based on publish mode and lockfile presence.

## Returns

[`JavaScriptAppResource`](/reference/api/go/aspire.hosting.javascript/javascriptappresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

- [JavaScriptAppResource](/reference/api/go/aspire.hosting.javascript/javascriptappresource.md) -- `handle`
