os.platform()
- 返回:<string>
返回一个字符串,标识 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'。Android 支持处于试验阶段。
【The value 'android' may also be returned if Node.js is built on the Android
operating system. Android support is experimental.】