🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

os-name

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

os-name

Get the name of the current operating system. Example: macOS Sierra

6.1.0
latest
Version published
Weekly downloads
2.8M
-19.55%
Maintainers
1
Weekly downloads
 
Created

What is os-name?

The os-name npm package is a simple utility that allows you to get the name of the operating system in a human-readable format. It is useful for logging, debugging, and displaying system information in a user-friendly way.

What are os-name's main functionalities?

Get OS Name

This feature allows you to get the name of the operating system. The code sample demonstrates how to use the os-name package to print the OS name to the console.

const osName = require('os-name');
console.log(osName());

Get OS Name with Version

This feature allows you to get the name of the operating system along with its version. The code sample shows how to use the os-name package to print the OS name and version to the console.

const osName = require('os-name');
console.log(osName(os.platform(), os.release()));

Other packages similar to os-name

FAQs

Package last updated on 22 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts