VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-os-release-method/

⇱ Node.js os.release() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js os.release() Method

Last Updated : 28 Apr, 2025

The os.release() method is an inbuilt application programming interface of the os module which is used to get Operating system release.

Syntax: 

os.release()

Parameters: This method does not accept any parameters.
Return Value: This method returns a string that represents operating system release. 

Below examples illustrate the use of os.release() method in Node.js:

Example 1:  

Output: On windows system 

10.0.17763


Output: On Linux system 

3.10.0-1062.1.1.el7.x86_64


Example 2: 

Output: 

Windows platform
Version: 10.0.17763

Note: The above program will compile and run by using the node index.js command.

Reference: https://nodejs.org/api/os.html#os_os_release
 

Comment

Explore