Core Module OS in Node.js — a practical guide to Node.js os module with clear examples you can reuse in real projects.
Core Module OS in Node.js — 11/55 in the Node.js series. Full playlist companion: Node.js complete course on YouTube. Prefer one article? Read the complete Node.js tutorial.
Short description
The `os` module helps with logging, health checks, and environment-aware configuration by exposing host machine details.
OS info example
const os = require('os');
console.log({
platform: os.platform(),
arch: os.arch(),
cpus: os.cpus().length,
freeMem: os.freemem(),
totalMem: os.totalmem(),
hostname: os.hostname(),
uptime: os.uptime(),
});