os-utils

an operating-system utility library

os-utils downloads os-utils version os-utils license

os-utils类似的npm包:
npm下载趋势
3 年
🌟 在 os-utils 的 README.md 中显示实时使用量图表,只需复制下面的代码。
## Usage Trend
[![Usage Trend of os-utils](https://npm-compare.com/img/npm-trend/THREE_YEARS/os-utils.png)](https://npm-compare.com/os-utils#timeRange=THREE_YEARS)
Cumulative GitHub Star Trend
🌟 在 os-utils 的 README.md 中显示 GitHub stars 趋势图表,只需复制下面的代码。
## GitHub Stars Trend
[![GitHub Stars Trend of os-utils](https://npm-compare.com/img/github-trend/os-utils.png)](https://npm-compare.com/os-utils)
统计详情
npm包名称
下载量
Stars
大小
Issues
发布时间
License
os-utils30,874246-1113 年前MIT
os-utils的README

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)