Node js os.machine() Method Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report 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. JavaScript // Node.js program to demonstrate the // os.machine() method // Require os module const os = require('os'); console.log(os.machine()); Output: x86_64Example 2: The below example illustrates the os.machine() method in Node js JavaScript // Node.js program to demonstrate the // os.machine() method // Require os module const os = require('os'); // Printing os.platform() value const platform = os.machine(); switch (platform) { case 'arm': console.log("arm machine type"); break; case 'arm64': console.log("ARM CPU architecture"); break; case 'x86_64': console.log("64-bit processing"); break; default: console.log("unknown platform"); } 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 Comment More infoAdvertise with us Next Article Node js os.machine() Method N neeraj3304 Follow Improve Article Tags : Web Technologies Node.js Node.js-os-module Similar Reads Node.js os.arch() Method The os.arch() method is an inbuilt application programming interface of the os module which is used to get CPU architecture of the computer for which the current node.js is compiled. Syntax: os.arch() Parameters: This method does not accept any parameters. Return Value: This method returns the opera 2 min read Node.js os.loadavg() Method The os.loadavg() method is an inbuilt application programming interface of the os module which is used to get the load average. Load average is a measure of system activity, expressed in a fractional number, calculated by the operating system. Syntax: os.loadavg() Parameters: This method does not a 2 min read Node.js process.kill() Method The process.kill( pid[,signal] ) is an inbuilt method of node.js which sends a signal to the process, pid (which is the process id) and signal is in the string format that is the signal to send. Syntax : process.kill(pid[, signal]) Parameters: This method accepts two parameters as mentioned above an 2 min read Node.js os.type() Method The os.type() method is an inbuilt application programming interface of the os module which is used to get Operating system name. Syntax: os.type() Parameters: This method does not accept any parameters.Return Value: This method returns a string that represents operating system name. The returned va 1 min read Node.js os.cpus() Method The os.cpus() method is an inbuilt application programming interface of the os module which is used to get information about each logical CPU core of the computer. Syntax: os.cpus() Parameters: This method does not accept any parameters. Return: This method returns an object containing information 3 min read Like