Skip to main content
net10.0net8.0net9.0

An Aspire integration for hosting Bun apps. DEPRECATED: Use Aspire.Hosting.JavaScript and builder.AddBunApp(...) instead. This package will be removed in a future release.

Published
Sep 12, 2026
1mo ago
Total Downloads
112.7K
112,693

Install

dotnet add package CommunityToolkit.Aspire.Hosting.Bun --version 13.5.1-beta.751
ProductVersions
.NET
net10.0net8.0net9.0

README

CommunityToolkit.Aspire.Hosting.Bun library

⚠️ DEPRECATION NOTICE
This package is deprecated. Bun support is now available in the core Aspire.Hosting.JavaScript package via AddBunApp(...).

Migration Guide:

  • Install Aspire.Hosting.JavaScript and remove CommunityToolkit.Aspire.Hosting.Bun.
  • Review existing builder.AddBunApp(...) calls carefully: if you pass arguments positionally, you may need to reorder them or convert them to named arguments when moving to the core package implementation.
  • If you're using TypeScript AppHost bindings, continue using builder.addBunApp(...) from the generated core bindings.

This package will be removed in a future release. Please migrate to Aspire.Hosting.JavaScript.

Provides extension methods and resource definitions for an Aspire AppHost to configure a Bun project.

Getting Started

Install the package

In your AppHost project, install the package using the following command:

dotnet add package CommunityToolkit.Aspire.Hosting.Bun

Example usage

Then, in the Program.cs file of AppHost, define a Bun resource, then call AddBunApp:

builder.AddBunApp("bun-server", "main.ts")
    .WithHttpEndpoint(env: "PORT")
    .WithEndpoint();

Migration from Toolkit Bun to core Bun

Toolkit API:

builder.AddBunApp("api", "server.ts")
    .WithHttpEndpoint(env: "PORT");

Core API (Aspire.Hosting.JavaScript):

builder.AddBunApp("api", "./api", "server.ts")
    .WithHttpEndpoint(env: "PORT")
    .WithExternalHttpEndpoints();

TypeScript AppHost (core bindings):

await builder
    .addBunApp("api", "./api", "server.ts")
    .withHttpEndpoint({ env: "PORT" })
    .withExternalHttpEndpoints();

Additional Information

https://learn.microsoft.com/dotnet/aspire/community-toolkit/hosting-bun

Feedback & contributing

https://github.com/CommunityToolkit/Aspire

Changes from Previous Version

v13.5.1-beta.748v13.5.1-beta.751
Deprecation Removed
Deprecation notice was removed in this version.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.