# NxAppResource Constructors

- Package: [CommunityToolkit.Aspire.Hosting.JavaScript.Extensions](/reference/api/csharp/communitytoolkit.aspire.hosting.javascript.extensions.md)
- Type: [NxAppResource](/reference/api/csharp/communitytoolkit.aspire.hosting.javascript.extensions/nxappresource.md)
- Kind: `Constructors`
- Members: `1`

A resource that represents a Node.js application running under Nx.

## NxAppResource(string, string, string, string)

- Name: `Constructor(string, string, string, string)`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.JavaScript.Extensions/NxAppResource.cs#L13-L18)

A resource that represents a Node.js application running under Nx.

```csharp
public class NxAppResource
{
    public NxAppResource(
        string name,
        string workingDirectory,
        string appName,
        string command = "nx")
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `workingDirectory` (`string`)
  The working directory of the application.
- `appName` (`string`)
  The Nx app name to run (used in 'nx serve {appName}').
- `command` (`string`) `optional`
  The command to run (default is 'nx').
