Build Output
Default output location
Section titled “Default output location”By default pure build writes the downloaded binary to the current directory,
named after the entry file without its extension:
| Entry file | Default output |
|---|---|
server.ts | ./server |
src/main.ts | ./main |
cli/index.js | ./index |
Pass -o/--out to choose an exact path:
pure build src/main.ts --release --out dist/myappThe binary is written with mode 0755, so it’s immediately executable:
./dist/myappPlatform matrix
Section titled “Platform matrix”Builds run in the cloud and target Linux. Cross-compilation to other operating systems is not currently available.
| Platform | Minimum OS |
|---|---|
| Linux x86_64 | glibc 2.31 (Debian 11 / Ubuntu 20.04) |
| Linux aarch64 | glibc 2.31 |
Pure binaries are dynamically linked against glibc. Running on Alpine Linux
(musl) requires a compatibility layer such as gcompat. See
Language → OS support for details.
Binary size
Section titled “Binary size”Release binaries include the Pure runtime. Typical sizes:
| Workload | Approximate size |
|---|---|
| Hello world | ~2 MB |
| HTTP server | ~4–6 MB |
| Complex CLI with deps | ~10–20 MB |
Strip the binary with strip to reduce size further:
strip ./myappNode addon output
Section titled “Node addon output”Passing --target node-addon produces a Node.js native addon instead of a
standalone executable. The downloaded artifact (written to --out) is an
installable npm tarball that you install like any other package:
pure build src/index.ts --release --target node-addon --out ./mypkg.tgznpm install ./mypkg.tgzThe tarball contains the compiled .node addon, a small index.js shim, the
preserved TypeScript types, and a package.json whose name and version are
inherited from your project. --target node-addon therefore requires a
package.json at or above your entry file.
Once installed, consumers require() it as usual:
const mypkg = require('mypkg');