Getting Started
Enable the package
tsonic init --surface @tsonic/js
tsonic add npm @tsonic/nodejs
tsonic restore
If the workspace is still CLR-first, switch surface to @tsonic/js first.
Start with normal Node-style imports
import * as fs from "node:fs";
import * as path from "node:path";
Example:
import * as fs from "node:fs";
import * as path from "node:path";
export function main(): void {
const file = path.join("src", "App.ts");
console.log(file, fs.existsSync(file));
}
Remember the model
@tsonic/jsis still the ambient surface@tsonic/nodejsis the package that addsnode:*modules- package metadata can add CLR framework/runtime requirements during restore
That last point is important: @tsonic/nodejs is not just a bag of .d.ts
files. Its package manifest actively contributes module aliases, runtime
packages, and framework requirements to the workspace.
Typical next steps
node:fsandnode:pathfor file/process worknode:httpfor serversnode:cryptofor hashes and signaturesnode:eventsfor emitter-style flowsnode:processfor process-level information and environment access