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+7c601010SharpTS 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.
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
- Install SharpTS with the setup script for your terminal.
Shell on Linux, WSL, or Apple Silicon macOS:
curl -fsSL https://sharpts.dev/setup.sh | shPowerShell on Windows:
irm https://sharpts.dev/setup.ps1 | iexThe 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.
- Create a file named
hello.tswith this small array-and-iteration example.
const names = ["Ada", "Grace", "Linus"];
for (const name of names) {
console.log(`Hello, ${name}!`);
}- Run the file directly.
sharpts hello.tsThe exact output is:
Hello, Ada!
Hello, Grace!
Hello, Linus!- On a machine with .NET installed, compile the same source to .NET IL, then run the resulting assembly.
sharpts --compile hello.ts
dotnet hello.dllThe 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
- Review setup-script options and advanced manual choices in Installation.
- Learn the four everyday execution modes in CLI basics.
- Follow the compiler from TypeScript source to .NET IL in Compilation and Native AOT.
- See how generated programs stay smaller in Tree shaking.
- Learn how type information accelerates hot paths in Performance.
- Understand how JavaScript behavior survives the move to .NET in JavaScript Semantics on .NET.
- Follow calls and suspended execution in Functions, Closures, and State Machines.
- See how an entry point becomes a compiled graph in Modules and Dependency Compilation.