title: How to get directory size in node.js without recursively going through directory?
body: <p>How do I get the size of a directory in node.js without recursively going through all the children in a directory?</p>
  
  <p>E.g.</p>
  
  <pre><code>var fs = require('fs');
  fs.statSync('path/to/dir');
  </code></pre>
  
  <p>Will return me an object like this,</p>
  
  <pre><code>{ dev: 16777220,
    mode: 16877,
    nlink: 6,
    uid: 501,
    gid: 20,
    rdev: 0,
    blksize: 4096,
    ino: 62403939,
    size: 204,
    blocks: 0,
    atime: Mon May 25 2015 20:54:53 GMT-0400 (EDT),
    mtime: Mon May 25 2015 20:09:41 GMT-0400 (EDT),
    ctime: Mon May 25 2015 20:09:41 GMT-0400 (EDT) }
  </code></pre>
  
  <p>But the <code>size</code> property is not the size of the directory and it's children (aka the sum of the files inside of it).</p>
  
  <p>Is there no way to get the size of a dir (w/the sizes of the files inside of it included) without recursively finding the sizes of the children (and then summing those up)?</p>
  
  <p>I'm basically trying to do the equivalent of <code>du -ksh my-directory</code> but if the given directory is really large (e.g <code>/</code>) than it takes forever to recursively get the true dir size..</p>