os.platform()


返回标识为其编译 Node.js 二进制文件的操作系统平台的字符串。 该值在编译时设置。 可能的值为 'aix''darwin''freebsd''linux''openbsd''sunos'、以及 'win32'

返回值相当于 process.platform

如果 Node.js 是在安卓操作系统上构建的,则也可能返回值 'android'安卓支持是实验的

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'.

The return value is equivalent to process.platform.

The value 'android' may also be returned if Node.js is built on the Android operating system. Android support is experimental.