process.arch
为其编译 Node.js 二进制文件的操作系统 CPU 架构。
可能的值为:'arm'
、'arm64'
、'ia32'
、'mips'
、'mipsel'
、'ppc'
、'ppc64'
、's390'
、's390x'
、以及 'x64'
。
import { arch } from 'node:process';
console.log(`This processor architecture is ${arch}`);
const { arch } = require('node:process');
console.log(`This processor architecture is ${arch}`);
The operating system CPU architecture for which the Node.js binary was compiled.
Possible values are: 'arm'
, 'arm64'
, 'ia32'
, 'mips'
,'mipsel'
, 'ppc'
,
'ppc64'
, 's390'
, 's390x'
, and 'x64'
.
import { arch } from 'node:process';
console.log(`This processor architecture is ${arch}`);
const { arch } = require('node:process');
console.log(`This processor architecture is ${arch}`);