Socket
Socket
Sign inDemoInstall

os

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

os

NodeJS Core Module Extended


Version published
Weekly downloads
611K
decreased by-0.67%
Maintainers
1
Weekly downloads
 
Created

What is os?

The 'os' npm package provides a set of operating system-related utility methods and properties. It allows you to interact with the operating system in a variety of ways, such as retrieving information about the system's architecture, CPUs, memory, and network interfaces.

What are os's main functionalities?

System Architecture

This feature allows you to get the operating system CPU architecture. The code sample prints the architecture of the CPU, such as 'x64' or 'arm'.

const os = require('os');
console.log(os.arch());

CPU Information

This feature provides information about each logical CPU core. The code sample prints an array of objects containing details about each CPU core, such as model, speed, and times.

const os = require('os');
console.log(os.cpus());

Free Memory

This feature allows you to get the amount of free system memory in bytes. The code sample prints the amount of free memory available on the system.

const os = require('os');
console.log(os.freemem());

Network Interfaces

This feature provides information about the network interfaces. The code sample prints an object containing details about each network interface, such as IP addresses and MAC addresses.

const os = require('os');
console.log(os.networkInterfaces());

Uptime

This feature allows you to get the system uptime in seconds. The code sample prints the number of seconds the system has been running.

const os = require('os');
console.log(os.uptime());

Other packages similar to os

Keywords

FAQs

Package last updated on 16 Apr 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc