Runtime & platforms
This page covers the runtimes that can host the openapi-ng
generator (the CLI / Node API that turns an OpenAPI spec into
TypeScript). For the runtime helpers shipped inside generated
output (rest.util.ts / rest.model.ts), see the Angular generator
guide.
Primary runtime
Section titled “Primary runtime”openapi-ng targets Node.js as its primary runtime: the generation
engine is a Rust binary loaded via NAPI-RS.
Requires Node.js 22.12+.
Bun and Deno are supported on the same native path because both
implement N-API and pick up the prebuilt .node artifact directly.
Platforms
Section titled “Platforms”Pre-built native binaries are published for:
- macOS (x64, ARM64)
- Linux glibc (x64, ARM64)
- Linux musl (x64, ARM64) — Alpine and other musl-based images
- Windows (x64, ARM64)
The correct glibc or musl artifact is selected at load time, so Alpine and distroless images need no extra configuration.
On any other platform (FreeBSD, 32-bit, etc.), require of the package
throws an explicit unsupported-platform error listing the supported set
— open an issue if you need an additional target.
Browser and edge runtimes
Section titled “Browser and edge runtimes”openapi-ng does not support browser runtimes, Cloudflare Workers,
Vercel Edge, Deno Deploy, or any other host that cannot load a native
N-API binary. The package ships a browser.js stub that any
browser-aware bundler (Vite, Webpack, esbuild) will resolve in those
contexts; calling generate() from it throws a GenerateError with
code E_UNSUPPORTED_RUNTIME.
Code generation is a build-time activity — run it from a Node script,
not from a browser bundle. See
E_UNSUPPORTED_RUNTIME
for the error shape.