title: How does NodeJS OS Module work
body: <p>Nodejs has a built in OS module that we can use by having this line in our code</p>
  
  <pre><code>var os = require('os');
  </code></pre>
  
  <p>There are a number of functions to use such as getting free memory, total memory, cpu usage, load average, etc.</p>
  
  <p>My question here is <strong>HOW</strong> does nodejs calculate this information? </p>
  
  <p>For example, the free/total RAM memory, how is that being done under curtains. Is it calling another process to read stats from the system? is it running a separate command like <code>iostat</code> or <code>dstat</code>? How is it actually retrieving that data for us?</p>