WeChooz.Aspire.Hosting.NpmRestore 1.0.2

Prefix Reserved
dotnet add package WeChooz.Aspire.Hosting.NpmRestore --version 1.0.2
                    
NuGet\Install-Package WeChooz.Aspire.Hosting.NpmRestore -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WeChooz.Aspire.Hosting.NpmRestore" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WeChooz.Aspire.Hosting.NpmRestore" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="WeChooz.Aspire.Hosting.NpmRestore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WeChooz.Aspire.Hosting.NpmRestore --version 1.0.2
                    
#r "nuget: WeChooz.Aspire.Hosting.NpmRestore, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WeChooz.Aspire.Hosting.NpmRestore@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WeChooz.Aspire.Hosting.NpmRestore&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=WeChooz.Aspire.Hosting.NpmRestore&version=1.0.2
                    
Install as a Cake Tool

WeChooz Aspire Hosting npm restore

CI

This project adds the ability to restore npm packages when launching a project in .NET Aspire.

Get started

To get started, install the install the 📦 WeChooz.Aspire.Hosting.NpmRestore NuGet package in the AppHost project.

.NET CLI

dotnet add package WeChooz.Aspire.Hosting.NpmRestore

Example usage

To add the npm restore resource, call the AddNpmRestore method on a IResourceBuilder<ProjectResource> instance (after calling AddProject):

builder.AddProject<Projects.WebApplication>("webapplication")
       .AddNpmRestore();

You can configure some options by passing a delegate to the AddNpmRestore method:

builder.AddProject<Projects.WebApplication>("webapplication")
       .AddNpmRestore(options => {...});

Following options are available:

Name Default value Description
AlwaysRun true Defines if the resource should always run, or should be explicitly run.
PackageManagerExecutableName "npm" Defines the name of the executable to process the package restore.
RestoreCommandAndArgs ["i"] Defines the command to execute to restore the packages.
ResourceNameFormat (string projectName) => $"{projectName}-restore" Defines the format to compute the name of the restore resource from the name of the project.
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 542 8/9/2025
1.0.1 108 8/9/2025
1.0.0 112 8/9/2025