![]() |
VOOZH | about |
The os.machine method is an inbuilt application programming interface of the os module which is used to get the machine type. The os package contains the required function to perform operating system operations.
Syntax:
os.machine()
Parameters: This function does not have any parameters.
Return Value: This function returns the machine type in the string type. Returns the machine type as a string, such as arm, arm64, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64.
Example 1: The below example illustrates the os.machine() method in Node js.
Note: The output may be different according to your computer operating system.
Output:
x86_64Example 2: The below example illustrates the os.machine() method in Node js
Output:
64-bit processingNote: The above program will compile and run by using the node index.js command.
Reference:https://nodejs.org/api/os.html#osmachine