# Aspire.Hosting.JavaScript

- Module: `Aspire.Hosting.JavaScript`
- Version: `17.0.0`
- Import path: `apphost/modules/aspire`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)
- Functions: `35`
- Types: `10`

## Handles

- [BunAppResource](/reference/api/go/aspire.hosting.javascript/bunappresource.md) -- `handle` - 1 members -- A resource that represents a Bun application.
- [DenoAppResource](/reference/api/go/aspire.hosting.javascript/denoappresource.md) -- `handle` - 17 members -- A resource that represents a Deno application.
- [JavaScriptAppResource](/reference/api/go/aspire.hosting.javascript/javascriptappresource.md) -- `handle` - 12 members -- A resource that represents a JavaScript application.
- [NextJsAppResource](/reference/api/go/aspire.hosting.javascript/nextjsappresource.md) -- `handle` - 2 members -- Represents a Next.js application resource.
- [NodeAppResource](/reference/api/go/aspire.hosting.javascript/nodeappresource.md) -- `handle` - 1 members -- A resource that represents a node application.
- [ResourceWithServiceDiscovery](/reference/api/go/aspire.hosting.javascript/resourcewithservicediscovery.md) -- `interface` `marker` - 0 members
- [ViteAppResource](/reference/api/go/aspire.hosting.javascript/viteappresource.md) -- `handle` - 2 members -- Represents a Vite application resource that can be managed and executed within a Node.js environment.

## Enums

- [DenoInspectMode](/reference/api/go/aspire.hosting.javascript/denoinspectmode.md) -- `enum` - 3 values -- The Deno inspector flavor.
- [DenoNodeModulesDirMode](/reference/api/go/aspire.hosting.javascript/denonodemodulesdirmode.md) -- `enum` - 3 values -- Controls how Deno manages a local `node_modules` directory.
- [DenoPermissionKind](/reference/api/go/aspire.hosting.javascript/denopermissionkind.md) -- `enum` - 8 values -- A granular Deno permission grant/denial (for example `--allow-net` or `--deny-read`).

## Functions

- [WithDenoAllow](/reference/api/go/aspire.hosting.javascript/withdenoallow.md) -- `method` - on `DenoAppResource` -- Grants a Deno permission, optionally scoped to the supplied values.
- [WithDenoAllowAll](/reference/api/go/aspire.hosting.javascript/withdenoallowall.md) -- `method` - on `DenoAppResource` -- Controls the blanket `-A`/`--allow-all` grant.
- [WithDenoConfig](/reference/api/go/aspire.hosting.javascript/withdenoconfig.md) -- `method` - on `DenoAppResource` -- Sets `--config <file>` (path to a `deno.json`/`deno.jsonc`).
- [WithDenoDeny](/reference/api/go/aspire.hosting.javascript/withdenodeny.md) -- `method` - on `DenoAppResource` -- Denies a Deno permission, optionally scoped to the supplied values.
- [WithDenoImportMap](/reference/api/go/aspire.hosting.javascript/withdenoimportmap.md) -- `method` - on `DenoAppResource` -- Sets `--import-map <file>`.
- [WithDenoInspect](/reference/api/go/aspire.hosting.javascript/withdenoinspect.md) -- `method` - on `DenoAppResource` -- Enables a Deno inspector mode, optionally at `hostPort` (for example `127.0.0.1:9229`).
- [WithDenoLock](/reference/api/go/aspire.hosting.javascript/withdenolock.md) -- `method` - on `DenoAppResource` -- Sets `--lock <file>`.
- [WithDenoNodeModulesDir](/reference/api/go/aspire.hosting.javascript/withdenonodemodulesdir.md) -- `method` - on `DenoAppResource` -- Sets `--node-modules-dir`, optionally with a mode emitted as `--node-modules-dir=<mode>`.
- [WithDenoNoLock](/reference/api/go/aspire.hosting.javascript/withdenonolock.md) -- `method` - on `DenoAppResource` -- Sets `--no-lock`, disabling lockfile use.
- [WithDenoRun](/reference/api/go/aspire.hosting.javascript/withdenorun.md) -- `method` - on `DenoAppResource` -- Selects the `deno run <entrypoint>` mode (the default).
- [WithDenoRuntimeArgs](/reference/api/go/aspire.hosting.javascript/withdenoruntimeargs.md) -- `method` - on `DenoAppResource` -- Appends raw runtime arguments injected verbatim BEFORE the entrypoint. This is the escape hatch that gives full parity with `AddExecutable("name", "deno", workdir, args...)` for any flag not covered by a dedicated `WithDeno*` method.
- [WithDenoScriptArgs](/reference/api/go/aspire.hosting.javascript/withdenoscriptargs.md) -- `method` - on `DenoAppResource` -- Appends arguments passed to the script AFTER the entrypoint. Deno forwards everything after the entrypoint to the running program.
- [WithDenoServe](/reference/api/go/aspire.hosting.javascript/withdenoserve.md) -- `method` - on `DenoAppResource` -- Selects the `deno serve <entrypoint>` mode for serving an HTTP entrypoint.
- [WithDenoTask](/reference/api/go/aspire.hosting.javascript/withdenotask.md) -- `method` - on `DenoAppResource` -- Selects the `deno task <taskName>` mode, running a task defined in `deno.json` instead of a script entrypoint. Permissions are defined by the task itself and are not emitted for this mode.
- [WithDenoUnstable](/reference/api/go/aspire.hosting.javascript/withdenounstable.md) -- `method` - on `DenoAppResource` -- Adds one or more `--unstable-*` flags. Each feature may be supplied bare (for example `"kv"`, `"worker-options"`, `"sloppy-imports"`) or fully qualified (`"--unstable-kv"`).
- [WithDenoWatch](/reference/api/go/aspire.hosting.javascript/withdenowatch.md) -- `method` - on `DenoAppResource` -- Enables `--watch` (or `--watch-hmr` when `hmr` is `true`).
- [AddBunApp](/reference/api/go/aspire.hosting.javascript/addbunapp.md) -- `method` - on `DistributedApplicationBuilder` -- Adds a Bun application to the application model. Bun should be available on the PATH.
- [AddDenoApp](/reference/api/go/aspire.hosting.javascript/adddenoapp.md) -- `method` - on `DistributedApplicationBuilder` -- Adds a Deno application to the application model. Deno should be available on the PATH.
- [AddJavaScriptApp](/reference/api/go/aspire.hosting.javascript/addjavascriptapp.md) -- `method` - on `DistributedApplicationBuilder` -- Adds a JavaScript application resource to the distributed application using the specified app directory and run script.
- [AddNextJsApp](/reference/api/go/aspire.hosting.javascript/addnextjsapp.md) -- `method` - on `DistributedApplicationBuilder` -- Adds a Next.js app to the distributed application builder.
- [AddNodeApp](/reference/api/go/aspire.hosting.javascript/addnodeapp.md) -- `method` - on `DistributedApplicationBuilder` -- Adds a node application to the application model. Node should be available on the PATH.
- [AddViteApp](/reference/api/go/aspire.hosting.javascript/addviteapp.md) -- `method` - on `DistributedApplicationBuilder` -- Adds a Vite app to the distributed application builder.
- [PublishAsNodeServer](/reference/api/go/aspire.hosting.javascript/publishasnodeserver.md) -- `method` - on `JavaScriptAppResource` -- Configures the JavaScript application to publish as a standalone Node.js server that runs a built artifact directly.
- [PublishAsPackageScript](/reference/api/go/aspire.hosting.javascript/publishaspackagescript.md) -- `method` - on `JavaScriptAppResource` -- Configures the JavaScript application to publish as a server that runs a package manager script at runtime.
- [PublishAsStaticWebsite](/reference/api/go/aspire.hosting.javascript/publishasstaticwebsite.md) -- `method` - on `JavaScriptAppResource` -- Publishes the JavaScript application as a standalone static website using YARP.
- [WithBrowserDebugger](/reference/api/go/aspire.hosting.javascript/withbrowserdebugger.md) -- `method` - on `JavaScriptAppResource` -- 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.
- [WithBuildScript](/reference/api/go/aspire.hosting.javascript/withbuildscript.md) -- `method` - on `JavaScriptAppResource` -- Adds a build script annotation to the resource builder using the specified command-line arguments.
- [WithBun](/reference/api/go/aspire.hosting.javascript/withbun.md) -- `method` - on `JavaScriptAppResource` -- Configures the JavaScript resource to use Bun as the package manager and optionally installs packages before the application starts.
- [WithDeno](/reference/api/go/aspire.hosting.javascript/withdeno.md) -- `method` - on `JavaScriptAppResource` -- Configures the JavaScript resource to use Deno as the package manager.
- [WithNpm](/reference/api/go/aspire.hosting.javascript/withnpm.md) -- `method` - on `JavaScriptAppResource` -- Configures the Node.js resource to use npm as the package manager and optionally installs packages before the application starts.
- [WithPnpm](/reference/api/go/aspire.hosting.javascript/withpnpm.md) -- `method` - on `JavaScriptAppResource` -- Configures the Node.js resource to use pnpm as the package manager and optionally installs packages before the application starts.
- [WithRunScript](/reference/api/go/aspire.hosting.javascript/withrunscript.md) -- `method` - on `JavaScriptAppResource` -- Adds a run script annotation to the specified JavaScript application resource builder, specifying the script to execute and its arguments during run mode.
- [WithYarn](/reference/api/go/aspire.hosting.javascript/withyarn.md) -- `method` - on `JavaScriptAppResource` -- Configures the Node.js resource to use yarn as the package manager and optionally installs packages before the application starts.
- [DisableBuildValidation](/reference/api/go/aspire.hosting.javascript/disablebuildvalidation.md) -- `method` - on `NextJsAppResource` -- Disables deploy-time build validation checks for the Next.js application.
- [WithViteConfig](/reference/api/go/aspire.hosting.javascript/withviteconfig.md) -- `method` - on `ViteAppResource` -- Configures the Vite app to use the specified Vite configuration file instead of the default resolution behavior.
