프로젝트
GitHub에서 보기
oscmejia/os-utils
소개
OS Utils
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalos-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){
console.log( 'CPU Free:' + 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 seconds the system has been running for
os.sysUptime();
Get the number of seconds 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)
관련 프로젝트 살펴보기
불러오는 중…