글

라벨이 MacOS인 게시물 표시

node.js check how long you run your PC

이미지
  Please read how to initialize npm from this  post. 1. Uptime First, you need to type the 'const os = require('os');' to import the os module. After that type 'console.log(os.uptime());'.  Now run the node to run index.js or index. Enter: need to check your file path - node index.js - node index The number is a second. 2. variable build const variable to put 'os.uptime()' - 'os_time' 3. Divide the number to 3600(using console.log) Now print the number(os_time/3600) to find how long your does your OS run(hour).

node.js check your RAM specification

이미지
  Please read how to initialize npm from this  post. 1. Free Memory First, you need to type the 'const os = require('os');' to import the os module. After that type 'console.log(os.freemem());'.  Now run the node to run index.js or index. Enter: need to check your file path - node index.js - node index 2. Total Memory First, you need to type the 'const os = require('os');' to import the os module. After that type 'console.log(os.totalmem());'.  Now run the node to run index.js or index. Enter: need to check your file path - node index.js - node index After you type 1,2 Your OS system RAM info will appear on the Terminal.

node.js check your CPU specification

이미지
 Please read how to initialize npm from this post. 1. Arch First, you need to type the 'const os = require('os');' to import the os module. After that type 'console.log(os.arch());'.  Now run the node to run index.js or index. Enter: need to check your file path - node index.js - node index 2. CPUs First, you need to type the 'const os = require('os');' to import the os module. After that type 'console.log(os.cpus());'.  Now run the node to run index.js or index. Enter: need to check your file path - node index.js - node index After you type 1,2 Your OS system CPU info will appear on the Terminal.

node.js check your OS specification

이미지
Enter 'npm init' to install 'package.json' Use Terminal to enter the information. Check your information and press 'enter'. Check your package.json. First, you need to type the 'const os = require('os');' to import the os module. After that type 'console.log(os.platform());'.  Now run the node to run index.js or index. Enter: need to check your file path - node index.js - node index Your OS system will appear.