# JavaScriptAppResource

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

A resource that represents a JavaScript application.

## Definition

```go
type JavaScriptAppResource interface {
    IComputeResource
    Resource
    ResourceWithArgs
    ResourceWithContainerFiles
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithServiceDiscovery
    ResourceWithWaitSupport
}
```

## Embeds

- `IComputeResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithContainerFiles`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- [`ResourceWithServiceDiscovery`](/reference/api/go/aspire.hosting.javascript/resourcewithservicediscovery.md)
- `ResourceWithWaitSupport`

## Properties

- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property

## Methods

- [PublishAsNodeServer](/reference/api/go/aspire.hosting.javascript/javascriptappresource/publishasnodeserver.md) -- `method` -- Configures the JavaScript application to publish as a standalone Node.js server that runs a built artifact directly.
  ```go
  PublishAsNodeServer(entryPoint string, options ...*PublishAsNodeServerOptions) JavaScriptAppResource
  ```
- [PublishAsPackageScript](/reference/api/go/aspire.hosting.javascript/javascriptappresource/publishaspackagescript.md) -- `method` -- Configures the JavaScript application to publish as a server that runs a package manager script at runtime.
  ```go
  PublishAsPackageScript(options ...*PublishAsPackageScriptOptions) JavaScriptAppResource
  ```
- [PublishAsStaticWebsite](/reference/api/go/aspire.hosting.javascript/javascriptappresource/publishasstaticwebsite.md) -- `method` -- Publishes the JavaScript application as a standalone static website using YARP.
  ```go
  PublishAsStaticWebsite(options ...*PublishAsStaticWebsiteOptions) JavaScriptAppResource
  ```
- [WithBrowserDebugger](/reference/api/go/aspire.hosting.javascript/javascriptappresource/withbrowserdebugger.md) -- `method` -- Configures a browser debugger for the JavaScript application resource, enabling browser-based debugging through a child resource that launches when the parent application is ready.
  ```go
  WithBrowserDebugger(options ...*WithBrowserDebuggerOptions) JavaScriptAppResource
  ```
- [WithBuildScript](/reference/api/go/aspire.hosting.javascript/javascriptappresource/withbuildscript.md) -- `method` -- Adds a build script annotation to the resource builder using the specified command-line arguments.
  ```go
  WithBuildScript(scriptName string, options ...*WithBuildScriptOptions) JavaScriptAppResource
  ```
- [WithBun](/reference/api/go/aspire.hosting.javascript/javascriptappresource/withbun.md) -- `method` -- Configures the JavaScript resource to use Bun as the package manager and optionally installs packages before the application starts.
  ```go
  WithBun(options ...*WithBunOptions) JavaScriptAppResource
  ```
- [WithDeno](/reference/api/go/aspire.hosting.javascript/javascriptappresource/withdeno.md) -- `method` -- Configures the JavaScript resource to use Deno as the package manager.
  ```go
  WithDeno(options ...*WithDenoOptions) JavaScriptAppResource
  ```
- [WithNpm](/reference/api/go/aspire.hosting.javascript/javascriptappresource/withnpm.md) -- `method` -- Configures the Node.js resource to use npm as the package manager and optionally installs packages before the application starts.
  ```go
  WithNpm(options ...*WithNpmOptions) JavaScriptAppResource
  ```
- [WithPnpm](/reference/api/go/aspire.hosting.javascript/javascriptappresource/withpnpm.md) -- `method` -- Configures the Node.js resource to use pnpm as the package manager and optionally installs packages before the application starts.
  ```go
  WithPnpm(options ...*WithPnpmOptions) JavaScriptAppResource
  ```
- [WithRunScript](/reference/api/go/aspire.hosting.javascript/javascriptappresource/withrunscript.md) -- `method` -- Adds a run script annotation to the specified JavaScript application resource builder, specifying the script to execute and its arguments during run mode.
  ```go
  WithRunScript(scriptName string, options ...*WithRunScriptOptions) JavaScriptAppResource
  ```
- [WithYarn](/reference/api/go/aspire.hosting.javascript/javascriptappresource/withyarn.md) -- `method` -- Configures the Node.js resource to use yarn as the package manager and optionally installs packages before the application starts.
  ```go
  WithYarn(options ...*WithYarnOptions) JavaScriptAppResource
  ```
