SharpTS is a TypeScript interpreter and ahead-of-time compiler written in C# for .NET 10. It parses and type-checks TypeScript directly, then either executes the syntax tree or emits .NET IL; there is no JavaScript transpilation step.
Install the command-line tool from NuGet:
dotnet tool install --global SharpTSSelf-contained managed and Native AOT binaries are also published on GitHub Releases. See the Native AOT guide before choosing the native build because it deliberately has a smaller interop and tooling surface.
Create hello.ts:
interface Greeting {
name: string;
}
const greeting: Greeting = { name: "SharpTS" };
console.log(`Hello, ${greeting.name}!`);Run it directly:
sharpts hello.tsRunning sharpts without a file starts the interactive REPL.
Compile the same program to a runnable .NET assembly:
sharpts --compile hello.ts -o hello.dll
dotnet hello.dllUse --target exe for an executable target, or the SharpTS.Sdk MSBuild SDK for repeatable .NET
project builds. Compiled output embeds the runtime it needs and only copies SharpTS.dll when an
emitted soft-dependent feature requires it.
- TypeScript syntax, type checking, modules, projects, declarations, JSX/TSX, async functions, decorators, and JavaScript built-ins
- Interpreter and compiled-IL execution with a documented parity contract
- Node-compatible built-in modules and real npm package loading
.NETimports, external assemblies and NuGet references, C# consumption, and embedding APIs- MSBuild SDK integration, interpreted and compiled TypeScript-source debugging, and a standalone language server
- Retained Avalonia desktop applications written in TypeScript/TSX
- Managed self-contained and Native AOT distribution options
The current capability matrix and known gaps are in STATUS.md.
Start with the documentation hub for task-oriented guides. Runnable examples are collected in the samples cookbook. Contributors should read CONTRIBUTING.md and ARCHITECTURE.md.
SharpTS is licensed under the MIT License.