Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Node.js

Core Module OS in Node.js

Get system information with the os module: platform, memory, CPU, hostname, and uptime.

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(),
});

Leave a reply

Your email address will not be published. Required fields are marked *