Sequence NODE_224
Easy

Log System Information to Console

Node.js
Technical Specification

Write a script that logs OS platform, total memory, free memory, and CPU count.

Input/Output Samples
Input:node sysinfo.js
Output:Platform: win32, CPUs: 8, ...
Optimal Logic Path
const os = require("os");

console.log("Platform:", os.platform());
console.log("Total memory (MB):", (os.totalmem() / 1024 / 1024).toFixed(0));
console.log("Free memory (MB):", (os.freemem() / 1024 / 1024).toFixed(0));
console.log("CPU cores:", os.cpus().length);
Architectural Deep-Dive
The os module exposes system-level info like memory and CPU which is useful for diagnostics.