0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

めざせNode.jsライブラリマスター (10)windows-cpu

Posted at

#【ライブラリ説明】
 CPUやメモリの情報を取得できる

#【プログラム】

windows-cpu.js
var cpu = require('windows-cpu');

// Get total load on server for each CPU
cpu.totalLoad(function(error, results) {
	if(error) {
	return console.log(error);
	}

  console.log(results);
  //[ 11 ]
});

cpu.totalMemoryUsage(function(error, results) {
      if(error) {
          return console.log(error);
      }

      console.log('Total Memory Usage: ', results);
      /*
      Total Memory Usage:  { usageInKb: 3544692,
      usageInMb: 3461.61328125,
      usageInGb: 3.380481719970703 }
      */
 });

#【参考サイト】
 npm
 github

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?