title: Get size of folder using du command
body: <p>I used to get size of directory using this code in my electron app</p>
  
  <pre><code>var util  = require('util'),
  spawn = require('child_process').spawn,
  size    = spawn('du', ['-sh', '/path/to/dir']);
  
  size.stdout.on('data', function (data) {
  console.log('size: ' + data);
  });
  </code></pre>
  
  <p>It works in my machine. when i take build and run in another windows machine it throws du is not recognized as internal command like that...</p>
  
  <ol>
  <li>Why this works in my machine only not other windows machines. </li>
  <li>And also i doubt that it works in linux / mac machines ???</li>
  <li>how this du command works ??</li>
  </ol>
  
  <p>Or else is there any universal way to get size of the directory in all three platforms and all machines.</p>