# The os Module — Node.js Fundamentals: Modules, Async and Servers

Source: https://www.skillbyai.com/en/nodejs/node-os

> Inspect the platform, CPU count and memory of the host machine with the os module.

## System info

Useful for logging, diagnostics, or scaling decisions (e.g. worker count).

```javascript
import os from "node:os";

console.log(os.platform());     // 'linux'
console.log(os.cpus().length);  // number of cores
console.log(os.totalmem());     // bytes
console.log(os.homedir());
```
