Skip to content

About os.platform() and os.arch() in Node.js

os.platform()

The return value is equivalent to process.platform.

OSReturn value of os.platform()
macOSdarwin
Linuxlinux
Windowswin32

os.arch()

The return value is equivalent to process.arch.

ArchitectureReturn value of os.arch()LLVMDocker PlatformDocker Ubuntu Image
arm(armv7, armv7l)armARMarm/v7arm32v7
arm64arm64AArch64arm64/v8arm64v8
ppc64le[1]ppc64PowerPCppc64leppc64le
s390xs390xSystemZs390xs390x
x64x64X86amd64amd64

  1. le stands for little-endian, but the os.arch() function does not distinguish between endianness and returns a single value. ↩︎