Documentation
On this page

Documentation is currently available in English.

Getting Started

Start using SharpTS

Install SharpTS, run a TypeScript program, and compile it to .NET IL in five minutes.

Tested with SharpTS 0.0.0-local+7c601010

SharpTS lets you run TypeScript directly or compile it to .NET IL. You can use familiar TypeScript for scripts, native command-line tools, server-side applications, and .NET libraries.

SharpTS quick-start flow. A TypeScript source file can run immediately through the interpreter or compile to .NET IL.

Choose your first workflow

Interpret for the shortest edit-run cycle. SharpTS type-checks your file and runs it immediately without a separate build artifact.

Compile when you want to distribute your program or integrate a .NET assembly or executable with another .NET application.

Run SharpTS in five minutes

  1. Install SharpTS with the setup script for your terminal.

Shell on Linux, WSL, or Apple Silicon macOS:

bash
curl -fsSL https://sharpts.dev/setup.sh | sh

PowerShell on Windows:

powershell
irm https://sharpts.dev/setup.ps1 | iex

The script uses the .NET global tool when the .NET 10 SDK is available. Otherwise, it installs the self-contained Native AOT build for the current operating system and architecture.

  1. Create a file named hello.ts with this small array-and-iteration example.
typescript
const names = ["Ada", "Grace", "Linus"];

for (const name of names) {
    console.log(`Hello, ${name}!`);
}
  1. Run the file directly.
bash
sharpts hello.ts

The exact output is:

Expected output
Hello, Ada!
Hello, Grace!
Hello, Linus!
  1. On a machine with .NET installed, compile the same source to .NET IL, then run the resulting assembly.
bash
sharpts --compile hello.ts
dotnet hello.dll

The compiled program prints the same output.

SharpTS checks TypeScript before it interprets or compiles your entry point, so type errors stop the program before execution.

Where to go next