# npm packages Local npm packages for the port, in the layout of the Go packages at the pin, and the port's own published set `tsc-rs` (see "tsc-rs releases" below). - `typescript`: Go's JS launcher (`bin/tsc`, `lib/tsc.js`, `lib/getExePath.js`) and JS API (`dist`). - `@typescript/typescript-linux-x64`: `lib/tsc` (a noembed build) and the lib files next to it. - `wasm` (`ts-rust-wasm`): the WebAssembly build for Node, Deno, Bun and browsers. See [wasm/README.md](wasm/README.md). The port adds one file to Go's layout: `install.js`, the postinstall (`lib/install.js`). On POSIX it rewrites `bin/tsc` as a sh and JS polyglot. sh runs it as an exec of the platform package's `lib/tsc` by a relative path, so `tsc` runs without Node, which saves about 20 ms on every run. Node (`node node_modules/typescript/bin/tsc`) runs it as Go's JS launcher. The exec keeps the real path of the binary in the platform package, where it reads the lib files. When the rewrite cannot happen, `bin/tsc` stays Go's JS launcher, which still works. The relative path is fixed at install. pnpm keeps a postinstall's result in its store (the side-effects cache) and gives it to a later install of the same package in another layout (hoisted, isolated or the global virtual store), where the path can name no file. Then `bin/tsc` runs Go's JS launcher with Node, as Go's package does, about 20 ms slower per run. Files: - `pack.mjs` writes the package dirs. It follows the Go checkout's `Herebyfile.mjs` (`buildNativePreviewPackages`, release profile `typescript`). - `install.js` is the postinstall. - `getExePath.js` and `tsc-rs-readme.md` replace Go's launcher lookup and README in `tsc-rs`. Build, test and time (see the header of each script): ```sh GOPORT_BUILD_VERSION=7.1.0-dev.goport.1 scripts/run-cargo-capped.sh build --release -p ts_goport --bin tsgo --features noembed GOPORT_PIN= scripts/goport/npm-pack.sh /rs target/release/tsgo GOPORT_PIN= scripts/goport/npm-pack.sh --go 7.1.0-dev.goport.1 /go scripts/goport/npm-test.sh /rs /test-rs scripts/goport/perf-npm.sh