# DenoAppHostingExtensions Methods

- Package: [CommunityToolkit.Aspire.Hosting.Deno](/reference/api/csharp/communitytoolkit.aspire.hosting.deno.md)
- Type: [DenoAppHostingExtensions](/reference/api/csharp/communitytoolkit.aspire.hosting.deno/denoapphostingextensions.md)
- Kind: `Methods`
- Members: `3`

Extension methods to support adding Deno to the `Hosting.IDistributedApplicationBuilder`.

## AddDenoApp(IDistributedApplicationBuilder, string, string, string?, string[]?, string[]?)

- Name: `AddDenoApp(IDistributedApplicationBuilder, string, string, string?, string[]?, string[]?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<DenoAppResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.Deno/DenoAppHostingExtensions.cs#L32-L47)

Adds a Deno application to the application model. Deno should available on the PATH.

```csharp
public static class DenoAppHostingExtensions
{
    public static IResourceBuilder<DenoAppResource> AddDenoApp(
        this IDistributedApplicationBuilder builder,
        string name,
        string scriptPath,
        string? workingDirectory = null,
        string[]? permissionFlags = null,
        string[]? args = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
  The `Hosting.IDistributedApplicationBuilder` to add the resource to.
- `name` (`string`)
  The name of the resource.
- `scriptPath` (`string`)
  The path to the script that Deno will execute.
- `workingDirectory` (`string?`) `optional`
  The working directory to use for the command. If null, the working directory of the current process is used.
- `permissionFlags` (`string[]?`) `optional`
  The permissions to grant to the program run.
- `args` (`string[]?`) `optional`
  The arguments to pass to the command.

## Returns

`IResourceBuilder<DenoAppResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## AddDenoTask(IDistributedApplicationBuilder, string, string?, string, string[]?)

- Name: `AddDenoTask(IDistributedApplicationBuilder, string, string?, string, string[]?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<DenoAppResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.Deno/DenoAppHostingExtensions.cs#L67-L81)

Adds a Deno task to the distributed application builder

```csharp
public static class DenoAppHostingExtensions
{
    public static IResourceBuilder<DenoAppResource> AddDenoTask(
        this IDistributedApplicationBuilder builder,
        string name,
        string? workingDirectory = null,
        string taskName = "start",
        string[]? args = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IDistributedApplicationBuilder`)
  The `Hosting.IDistributedApplicationBuilder` to add the resource to.
- `name` (`string`)
  The name of the resource.
- `workingDirectory` (`string?`) `optional`
  The working directory to use for the command. If null, the working directory of the current process is used.
- `taskName` (`string`) `optional`
  The deno task to execute. Defaults to "start".
- `args` (`string[]?`) `optional`
  The arguments to pass to the command.

## Returns

`IResourceBuilder<DenoAppResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

## WithDenoPackageInstallation(IResourceBuilder<DenoAppResource>, Action<IResourceBuilder<DenoInstallerResource>>)

- Name: `WithDenoPackageInstallation(IResourceBuilder<DenoAppResource>, Action<IResourceBuilder<DenoInstallerResource>>)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<DenoAppResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.Deno/DenoAppHostingExtensions.cs#L94)

Ensures the Deno packages are installed before the application starts using Deno as the package manager.

```csharp
public static class DenoAppHostingExtensions
{
    public static IResourceBuilder<DenoAppResource> WithDenoPackageInstallation(
        this IResourceBuilder<DenoAppResource> resource,
        Action<IResourceBuilder<DenoInstallerResource>>? configureInstaller = null)
    {
        // ...
    }
}
```

## Parameters

- `resource` (`IResourceBuilder<DenoAppResource>`)
  The Deno app resource.
- `configureInstaller` (`Action<IResourceBuilder<DenoInstallerResource>>`) `optional`
  Configure the Deno installer resource.

## Returns

`IResourceBuilder<DenoAppResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## Remarks

This overload is not available in polyglot app hosts. Use [DenoAppHostingExtensions.WithDenoPackageInstallation(IResourceBuilder<DenoAppResource>, Action<IResourceBuilder<DenoInstallerResource>>)](/reference/api/csharp/communitytoolkit.aspire.hosting.deno/denoapphostingextensions/methods.md#withdenopackageinstallation-iresourcebuilder-denoappresource-action-iresourcebuilder-denoinstallerresource) instead.

## ATS metadata

### Ignored by ATS

- Excluded from automatic Polyglot export.
