os.arch()
Returns the CPU architecture Node was compiled for.
Syntax
os.arch() Returns
string — e.g. 'x64', 'arm64', 'ia32'.
Examples
import { arch } from 'node:os';
console.log(arch());
Output
arm64
import { arch, platform } from 'node:os';
console.log(`${platform()}-${arch()}`);
Output
darwin-arm64
Notes
Reflects the Node binary's architecture, equal to `process.arch`.
Useful for selecting prebuilt native binaries or downloads.