# JavaScriptAppResource

- Module: [Aspire.Hosting.JavaScript](/reference/api/typescript/aspire.hosting.javascript.md)
- Version: `13.2.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

## Definition

```typescript
interface JavaScriptAppResource
  extends IComputeResource,
    IResource,
    IResourceWithArgs,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IResourceWithContainerFiles,
    IResourceWithServiceDiscovery {
  readonly command: string;
  readonly name: string;
  readonly workingDirectory: string;
  withBrowserDebugger(browser?: string): JavaScriptAppResource;
  withBuildScript(
      scriptName: string,
      args?: string[]): JavaScriptAppResource;
  withBun(
      install?: boolean,
      installArgs?: string[]): JavaScriptAppResource;
  withNpm(
      install?: boolean,
      installCommand?: string,
      installArgs?: string[]): JavaScriptAppResource;
  withPnpm(
      install?: boolean,
      installArgs?: string[]): JavaScriptAppResource;
  withRunScript(
      scriptName: string,
      args?: string[]): JavaScriptAppResource;
  withYarn(
      install?: boolean,
      installArgs?: string[]): JavaScriptAppResource;
}
```

## Properties

- `command`: `string` `get` -- Gets the Command property
- `name`: `string` `get` -- Gets the Name property
- `workingDirectory`: `string` `get` -- Gets the WorkingDirectory property

## Methods

- [withBrowserDebugger](/reference/api/typescript/aspire.hosting.javascript/javascriptappresource/withbrowserdebugger.md) -- `method` -- Configures a browser debugger for the JavaScript application
    ```typescript
  withBrowserDebugger(browser?: string): JavaScriptAppResource
  ```
- [withBuildScript](/reference/api/typescript/aspire.hosting.javascript/javascriptappresource/withbuildscript.md) -- `method` -- Specifies an npm script to run before starting the application
    ```typescript
  withBuildScript(scriptName: string, args?: string[]): JavaScriptAppResource
  ```
- [withBun](/reference/api/typescript/aspire.hosting.javascript/javascriptappresource/withbun.md) -- `method` -- Configures Bun as the package manager
    ```typescript
  withBun(install?: boolean, installArgs?: string[]): JavaScriptAppResource
  ```
- [withNpm](/reference/api/typescript/aspire.hosting.javascript/javascriptappresource/withnpm.md) -- `method` -- Configures npm as the package manager
    ```typescript
  withNpm(install?: boolean, installCommand?: string, installArgs?: string[]): JavaScriptAppResource
  ```
- [withPnpm](/reference/api/typescript/aspire.hosting.javascript/javascriptappresource/withpnpm.md) -- `method` -- Configures pnpm as the package manager
    ```typescript
  withPnpm(install?: boolean, installArgs?: string[]): JavaScriptAppResource
  ```
- [withRunScript](/reference/api/typescript/aspire.hosting.javascript/javascriptappresource/withrunscript.md) -- `method` -- Specifies an npm script to run during development
    ```typescript
  withRunScript(scriptName: string, args?: string[]): JavaScriptAppResource
  ```
- [withYarn](/reference/api/typescript/aspire.hosting.javascript/javascriptappresource/withyarn.md) -- `method` -- Configures yarn as the package manager
    ```typescript
  withYarn(install?: boolean, installArgs?: string[]): JavaScriptAppResource
  ```
