Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

os-utils

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

os-utils

an operating-system utility library

  • 0.0.14
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31K
increased by3.67%
Maintainers
1
Weekly downloads
 
Created
Source

os-utils

an operating-system utility library. Some methods are wrappers of Node libraries and others are calculation made by the module.

Instalation

One line instaltion with npm.

npm install os-utils

Then in your code

var os 	= require('os-utils');


os.cpuUsage(function(v){
	console.log( 'CPU Usage (%): ' + v );
});

os.cpuFree(function(v){

Usage

The follwoing methods are available:

Calculate CPU usage in the next second. This is not an average of CPU usage like in the "os" module. The callback will receive a parameter with the value

os.cpuUsage( callback );

Calculate free CPU in the next second. This is not based on average CPU usage like in the "os" module. The callback will receive a parameter with the value

os.cpuFree( callback );

Get the platform name

os.platform();

Get number of CPU

os.countCPUs()

Get current free memory

os.freemem()

Get total memory

os.totalmem()

Get a percentage reporesentinf the free memory

os.freememPercentage()

Get the number of miliseconds that the system has been running for.

os.sysUptime();

Get the number of miliseconds that the process has been running for.

os.processUptime() 

Get average load for the 1, 5 or 15 minutes

os.loadavg(1)
os.loadavg(5)
os.loadavg(15)

Keywords

FAQs

Package last updated on 30 Oct 2012

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