Complete the code to import the os module in Node.js.
const os = require([1]);The os module is imported using require('os') in Node.js.
Complete the code to get the system's hostname using the os module.
const hostname = os.[1]();os.platform() which returns the OS platform, not hostname.os.type() which returns the OS name.The os.hostname() method returns the system's hostname.
Fix the error in the code to get the total system memory.
const totalMem = os.[1]();os.freemem() which returns free memory, not total.os.memory() or os.getTotalMem().The correct method to get total system memory is os.totalmem().
Fill both blanks to create an object with OS type and CPU architecture.
const systemInfo = { type: os.[1](), arch: os.[2]() };os.platform() with os.type().os.hostname() instead of os.arch() for CPU info.os.type() returns the OS type and os.arch() returns the CPU architecture.
Fill all three blanks to create a summary string with platform, uptime, and user info.
const summary = `Platform: ${os.[1]()}, Uptime: ${os.[2]()} seconds, User: ${os.userInfo().[3]`;os.type() instead of os.platform() for platform.os.userInfo().name instead of username property.os.platform() gives the platform, os.uptime() gives system uptime in seconds, and os.userInfo().username gives the current user's name.
