Code Monkey home page Code Monkey logo

os-utils's Introduction

os-utils

An operating system utility library. Some methods are wrappers of node libraries and others are calculations made by the module.

Installation

One line installation 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 following methods are available:

Calculate CPU usage for the next second

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

os.cpuUsage( function(value) { /* ... */ } );

Calculate free CPU for the next second

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

os.cpuFree( function(value) { /* ... */ } );

Get the platform name

os.platform();

Get number of CPUs

os.cpuCount()

Get current free memory

os.freemem()

Get total memory

os.totalmem()

Get a current free memory percentage

os.freememPercentage()

Get the number of miliseconds the system has been running for

os.sysUptime();

Get the number of miliseconds the process has been running

os.processUptime() 

Get average load for 1, 5 or 15 minutes

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

os-utils's People

Contributors

bluefirex avatar empirefx avatar fidian avatar lorenzos avatar oscmejia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.