Getting Started
Enable JS Runtime APIs in a Tsonic Project
New project
tsonic init --js
Existing project
tsonic add js
That will:
- Install the
@tsonic/jsbindings package in your workspace (package.json) fortsctypechecking - Copy
libs/Tsonic.JSRuntime.dllinto your workspace - Add
libs/Tsonic.JSRuntime.dlltotsonic.workspace.jsonunderdotnet.libraries
Minimal Example
import { console, JSON } from "@tsonic/js/index.js";
export function main(): void {
const obj = JSON.parse<{ ok: boolean }>('{"ok": true}');
console.log(obj.ok);
}