| title | Getting Started |
|---|
tsonic init --surface @tsonic/js
tsonic add npm @tsonic/nodejs
tsonic restoreIf the workspace is still CLR-first, switch surface to @tsonic/js first.
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));
}@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.
node:fsandnode:pathfor file/process worknode:httpfor serversnode:cryptofor hashes and signaturesnode:eventsfor emitter-style flowsnode:processfor process-level information and environment access