Skip to content

TypeScript

Node.js 22.6 or later to execute generated .ts files through native type stripping.

From a prepared source module containing a main package:

Terminal window
goalchemy compile -target typescript -out out/typescript .
cd out/typescript
node --enable-source-maps main.ts

Or use goalchemy run -target typescript . to compile and execute in a temporary directory. Add -gate cooperative for source tasks or suspending operations.

The executable target emits ES2022 TypeScript in native ESM modules: main.ts, pkg_*.ts, leaf shared.ts, and selected rt/ files. Cooperative output adds portable program.ts and host.ts; main.ts remains the Node executable wrapper.

Every output includes its own README.md, selected runtime files, source mappings, and goalchemy.manifest.json. See the full output reference for the inventory and entry behavior.

Library output provides portable JavaScript and declarations for Node and browsers. The WebCrypto/fetch library graph is tested in Node and an actual browser. Browser consumers use the library API or portable host entry rather than the Node executable wrapper. Read the TypeScript library boundary.

Byte slices and arrays use native Uint8Array storage while retaining source nil, length, capacity, and aliasing behavior. Per-file .ts.map source maps support stack traces. The portable runHost(host) entry takes an explicit output/failure adapter.

Library boundary · Host operations · Byte storage