Registry / devops / tsonic

tsonic

JSON →
library0.0.84jsnpmunverified

Tsonic is a compiler that translates TypeScript into C# and compiles it to a NativeAOT binary. Current version 0.0.84 is pre-release and under active development with weekly commits. Compared to other TypeScript-to-native tools (like ts-node, Bun, Deno), Tsonic targets full ahead-of-time compilation via .NET NativeAOT, offering potential performance improvements and direct interoperability with the .NET ecosystem. It is CLI-based and requires Node.js 22+ and .NET 10 SDK. The package is distributed as a global or dev dependency npm package and is still experimental; breaking changes are likely.

npm install tsonic
INSTALL
IMPORT
SIG · TSONIC
T
tsonic
devopsjavascriptv0.0.84
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tsonic
npx tsonic init
import tsonic from 'tsonic'
Tsonic is a CLI tool, not a library. Use npx or global install to run commands.
TsonicConfig
type TsonicConfig = import('tsonic').TsonicConfig
import { TsonicConfig } from 'tsonic'
TsonicConfig is a type; imports should use `import type` for TypeScript v4.5+ best practices.
Surface
import type { Surface } from 'tsonic'
import { Surface } from 'tsonic'
Surface is a type; must use `import type` to avoid runtime errors.

Installs Tsonic globally, creates a new workspace, builds, and runs the default NativeAOT binary.

npm install -g tsonic npx tsonic init myapp cd myapp npx tsonic build npx tsonic run
Debug
Known issues
breakingVersion 0.x.x is pre-release; any minor/patch change may introduce breaking changes.
fix
Pin exact version and test frequently; expect breaking changes.
affects: <1.0.0
deprecatedCLI command `tsonic run` may be deprecated in future versions in favor of `tsonic execute`.
fix
Use `tsonic execute` if available, or follow issue tracker.
affects: >=0.0.1 <1.0.0
breakingRequires .NET 10 SDK; older .NET SDKs will fail.
fix
Install .NET 10 SDK from https://dotnet.microsoft.com/download/dotnet/10.0
affects: >=0.0.1
gotchaCLI commands must be run from a workspace directory initialized with `tsonic init`; otherwise commands fail silently.
fix
Run `tsonic init` before any other command.
affects: >=0.0.1
breakingThe `--surface` flag changed default surface from CLR to JS in v0.0.80.
fix
If you need CLR surface, pass `--surface @tsonic/clr` explicitly.
affects: >=0.0.80
Errors
Common errors & fixes
Error: .NET SDK version 10.0.100 not found. Ensure .NET 10 SDK is installed.
Missing required .NET 10 SDK.
fix
Install .NET 10 SDK from https://dotnet.microsoft.com/download/dotnet/10.0
tsonic: command not found
Tsonic not installed globally or npx not used.
fix
Run `npm install -g tsonic` or use `npx tsonic`.
tsonic build: not a workspace. Run 'tsonic init' first.
Current directory was not initialized with `tsonic init`.
fix
Run `npx tsonic init` in the desired workspace directory.
Upgrade
Version history
0.0.84latest on npm
Audit
Dependencies
nodeoptionalCLI runner and core tooling
dotnetrequiredRequired to compile C# to NativeAOT binary
Agent activity
4 hits · last 30 days
node
4
Resources
packagetsonic
tsonic — npm install tsonic · libregistry