os.platform()
返回标识为其编译 Node.js 二进制文件的操作系统平台的字符串。该值在编译时设置。可能的值为 'aix'
、'darwin'
、'freebsd'
、'linux'
、'openbsd'
、'sunos'
、以及 'win32'
。
¥Returns a string identifying the operating system platform for which
the Node.js binary was compiled. The value is set at compile time.
Possible values are 'aix'
, 'darwin'
, 'freebsd'
,'linux'
,
'openbsd'
, 'sunos'
, and 'win32'
.
返回值相当于 process.platform
。
¥The return value is equivalent to process.platform
.
如果 Node.js 是在安卓操作系统上构建的,则也可能返回值 'android'
。Android 支持是实验性的。
¥The value 'android'
may also be returned if Node.js is built on the Android
operating system. Android support is experimental.