Tools that help integrate Bun, A fast all-in-one JavaScript runtime, into your .NET projects.
Install the NuGet package:
dotnet add package BunDotNetUse it like this:
using BunDotNet;
// install the latest version of Bun
var runtime = await BunInstaller.InstallAsync();
// or install a specific version
var runtime = await BunInstaller.InstallAsync(version: BunVersion.Parse("1.3.6"));
// then use the bun cli to run a script
await runtime.RunAsync(args: ["run", "script.ts"], workingDirectory: Environment.CurrentDirectory);
// or list the installed versions
var versions = await BunInstaller.ListVersionsAsync();This is a .NET CLI tool that wraps the Bun CLI. It automatically sets up the Bun for you. The only requirement is .NET 10.
Run a TypeScript or JavaScript file using Bun from the command line:
dotnet tool exec BunDotNet.Cli -- wrapper -- run script.tsDo you need a specific version of Bun? No problem:
dotnet tool exec BunDotNet.Cli -- wrapper --version 1.3.6 -- run script.tsMore commands and options can be found by running:
dotnet tool exec BunDotNet.Cli -- --helpYou can also install the CLI tool in your project:
dotnet tool install BunDotNet.CliThen run it like this:
dotnet bun wrapper -- run script.tsPull requests are welcome. Please use Conventional Commits to keep commit messages consistent.
- Bun is an amazing project. This would not be possible without it.
Distributed under the MIT License. See LICENSE for more information.